Forum Discussion
bobby440
May 19, 2023Copper Contributor
Conditional formatting
Hi All, I have a requirement in excel. sheet 2,3,4 contains different companies data and sheet 1 is all data combined of sheet 2,3,4.now if i update any cell in the sheets 2 or 3 or 4 with ...
SnowMan55
May 21, 2023Bronze Contributor
Your request includes some ambiguities, and you showed no data or colors that could help resolve them.
- What do you mean by "if I update any cell … with a color"? Are you saying you manually change the background color (highlighting)? Or the text color (foreground color)? Or that you manually change a value, whose text color and/or background color is then affected, either by conditional formatting or a condition-based custom format?
- What do you mean by "i need the same to reflect in the master data tab"? The same value? The same color? Both? The answer is related to…
- Are non-blank entries for a company and week mutually exclusive across the country-specific worksheets? If not, are the values summed, or maybe appended? Do summed/appended values on the Master sheet colored based on values in the same way as on the country-specific sheets?
The VBA code shown in an earlier reply is misleading/nonfunctional:
- The masterSheet reference uses the wrong literal. Similarly for the entries assigned to dataSheets. However…
- The dataSheets array is pointless; a VBA collection (such as the Sheets object) cannot use an entire array as an index.
- The cell.Interior.Color property applies to a manually-assigned background color, but its value is not updated by conditional formatting.
- If you can come up with a valid Worksheet_Change event handler, you will need such an event handler (at least part of it; some code could be "shared") in each of the country-specific worksheets.