View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dianne Dianne is offline
external usenet poster
 
Posts: 107
Default Alternate row coloring

Sub ColourMe()

Dim rng As Range
Dim c As Range
Dim blnColour As Boolean

Set rng = ActiveSheet.Range("A2:A" &
ActiveSheet.Range("A65536").End(xlUp).Row)
Set rng = rng.SpecialCells(xlCellTypeVisible)
For Each c In rng
If blnColour Then
c.EntireRow.Interior.ColorIndex = 3
blnColour = Not blnColour
Else
c.EntireRow.Interior.ColorIndex = xlColorIndexNone
blnColour = Not blnColour
End If
Next c

Set c = Nothing
Set rng = Nothing

End Sub

Sub FaxIt()
Columns("A:A").AutoFilter Field:=1, Criteria1:="<"
Application.ActivePrinter = "Brother PC-FAX on BMFC:"
Call ColourMe
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Brother PC-FAX on BMFC:", Collate:=True
Columns("A:A").AutoFilter
End Sub

--
HTH,
Dianne

In ,
David Turner typed:
I've seen routines posted that color alternate rows in a range or
sheet, but I have a little different need.

I use the following routine a couple of times a month to fax in a food
order to a food distributing company. It filters out foods I don't
need from the list before faxing it.

Sub FaxIt()
Columns("A:A").AutoFilter Field:=1, Criteria1:="<"
Application.ActivePrinter = "Brother PC-FAX on BMFC:"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
"Brother PC-FAX on BMFC:", Collate:=True
Columns("A:A").AutoFilter
End Sub

I would like the filtered list to have alternate row coloring.

Any help?