![]() |
Formatting cell backgrounds based on cell contains
Hope someone can help with this little problem. Whilst I know it is
more than achievable I just can't seem to get my head round the code. The worksheet updates from a data source providing details of back orders. Column "A" contains the customer number, the data is also sorted on the column. So for alternative customer number we want to shade the background of those cells therefore making it easier to read. Whilst I can find many examples of shading alternate row, I can't find any for alternative blocks. Hope that makes sense. Many thanks in advance Alan |
Formatting cell backgrounds based on cell contains
On Jul 24, 9:14 am, Stephane Quenson
wrote: I would add a new column let's say G. I also assume that the first row is for headers and customer info starts at row 2. Put if G1 the value TRUE. Write the formula on G2: =IF(A2=A1, G1, NOT(G1)) and copy it down the range. Now G contains an alternance of TRUE and FALSE value. Select the whole range to color, then use the conditional formatting (Menu Format Conditional Formatting), select "Formula Is" and type "=$G2=TRUE" (without the quotes). Thanks Stephane but that is not quite what I want to do as the sheet automatically updates it data. What I'm looking for is a vba solution which can be placed in the onChange event handler. But many thanks for the suggestion. Kindest regards Alan Newton |
All times are GMT +1. The time now is 03:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com