R
RyanH
I currently have 1 conditional format on all worksheets. I want to add a 2nd
conditional format to all worksheets. This loop does not seem to work. Does
anyone have any ideas why?
Sub CFormat ()
Dim wks As Worksheet
For Each wks in Worksheets
'adds a bottom line to every 5th rows
wks.UsedRange.FormatConditions.Add Type:=xlExpression,
Formula2:="=MOD(ROW(),5)=0"
With wks.UsedRange.FormatConditions(2).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next wks
End Sub
conditional format to all worksheets. This loop does not seem to work. Does
anyone have any ideas why?
Sub CFormat ()
Dim wks As Worksheet
For Each wks in Worksheets
'adds a bottom line to every 5th rows
wks.UsedRange.FormatConditions.Add Type:=xlExpression,
Formula2:="=MOD(ROW(),5)=0"
With wks.UsedRange.FormatConditions(2).Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next wks
End Sub