vba experts - "Private Sub Workbook_BeforePrint"


Posted by Jim on January 25, 2002 10:13 AM

Hi,
This is my senario:
I have a worksheet that has random colored rows
(that change daily).
These random rows are colored light yellow in columns
B6:J500.
My question: Is it possible with Private Sub Workbook_
BeforePrint(Cancel As Boolean) to have it search
J6:J500 and if the cell is empty then clear the color
of that row "B6:J500" and replace it with the pattern
25% grey.
Any help on this matter would be greatly appreciated.
Jim

Posted by DUNO on January 25, 2002 10:20 AM

Posted by Jim on January 25, 2002 10:40 AM

DUNO, If you posted a reply it didn't post(NT)

Posted by Barrie Davidson on January 25, 2002 10:54 AM

You can try

Private Sub Workbook_BeforePrint(Cancel As Boolean)

For i = 6 To 10
If Range("J" & i).Value = "" Then
Rows(i).Interior.ColorIndex = xlNone
Rows(i).Interior.ColorIndex = 15
End If
Next i

End Sub


Regards,
BarrieBarrie Davidson

Posted by Barrie Davidson on January 25, 2002 10:55 AM

Oops, delete the line: "Rows(i).Interior.ColorIndex = xlNone" (nt)



Posted by Jim on January 25, 2002 12:13 PM

Barrie, i sent you an example, Jim