billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
Afternoon
My question today is I am trying to apply multiple conditions to a cell. The first condition formats the cell blue if the mod is 0. I would also like to format the font bold. (Maybe other formatting as well) The code I am using below. Thank You.
Sub format_every_other_row()
finalrow = Cells(Rows.Count, 1).End(xlUp).Row
For x = 1 To finalrow
If x Mod 2 = 0 Then
Cells(x, 1).Interior.Color = rgbCornflowerBlue
Else: Cells(x, 1).Interior.Color = rgbDeepPink
End If
Next
End Sub
My question today is I am trying to apply multiple conditions to a cell. The first condition formats the cell blue if the mod is 0. I would also like to format the font bold. (Maybe other formatting as well) The code I am using below. Thank You.
Sub format_every_other_row()
finalrow = Cells(Rows.Count, 1).End(xlUp).Row
For x = 1 To finalrow
If x Mod 2 = 0 Then
Cells(x, 1).Interior.Color = rgbCornflowerBlue
Else: Cells(x, 1).Interior.Color = rgbDeepPink
End If
Next
End Sub