I'm not having my brightest morning and can't seem to get around a simple problem I have.
I have a range of data in column B that I want Excel to cycle through. There are three specific values it needs to identify, and subsequently format those entire rows differently.
I've written this:
I know the answer is staring me in the face, but can anyone help me out?
I have a range of data in column B that I want Excel to cycle through. There are three specific values it needs to identify, and subsequently format those entire rows differently.
I've written this:
Code:
Dim j as long
For j = 12 To lastRow 'lastrow has been previously defined and is correct
If Cells(j, 2).Value = "Header 1" Or "Header 2" Or "Header 3" Then 'I keep getting an error here
Cells(j, "B").RowHeight = 25
Cells(j, "B").WrapText = False
Cells(j, "B").Font.Bold = True
Rows(j, "B").Font.Color = vbWhite
Rows(j, "B").Color = vbBlack 'black out the entire row to signify a header
End If
Next j
End With
I know the answer is staring me in the face, but can anyone help me out?