View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
PaulD PaulD is offline
external usenet poster
 
Posts: 92
Default Formatting of fields

"JeffH" wrote in message
...


: Thanks for your help. With your suggestions I have a working macro but
I'd
: like to clean it up a little. The new macro resets all lines except the
: first line, by choice. The only problem is that I'd like to limit that to
a
: specific column, in this case 'H'. How can I do just that?


Public Sub RowColor()
Dim i As Integer
Const RowStart As Integer = 2 'set this number to the starting row
Const RowEnd As Integer = 200 'set this number to the ending row

Range("H1").Interior.ColorIndex = 35 '<<--add this line
For i = RowStart To RowEnd
If (i - 1) Mod 4 1 Then
ActiveSheet.Rows(i).Interior.ColorIndex = 35
Else: ActiveSheet.Rows(i).Interior.ColorIndex = xlNone
End If
Next i

End Sub