1

I am having a problem changing the color of rows depending on if the cells in that row contain any writing. I am trying to do this formatting in VBA or if there are any suggestions that would be great.

Community
  • 1
  • 1
C noob
  • 21
  • 1
  • 4

2 Answers2

0

Color is different between version Excel 2003, Excel 2007, Excel 2010 and Excel 2013 but this remains constant:

Sheets(“Sheet1”).Range(“A” & n & “:D” & m).Interior.ColorIndex = 3

3 -> Red

Rizier123
  • 58,877
  • 16
  • 101
  • 156
0

Going for the "or not" part of the Title and assuming (1) a row extends from ColumnA to ColumnZ inclusive (can be extended) (2) the formatting is to apply when any cell in the row is not populated (can be reversed) and (3) a populated cell may contain either text or number value (can be adjusted) then:

Select ColumnsA:Z, HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true:

=COUNTA($A1:$Z1)=0

Format... and select formatting of choice, OK, OK.

pnuts
  • 58,317
  • 11
  • 87
  • 139