View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
retseort
 
Posts: n/a
Default Event macro that targets specific worksheet


Thanks for the responses. I tried the suggestions and the code does
nothing. Here is the code as per your suggestion.

Basically this code looks at rows 40 thru 70 and hides all rows that
are blank. I want it to run when I save or print.


Code:
--------------------
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "CLIENT_SOW" Then
Application.ScreenUpdating = False
BeginRow = 40
EndRow = 70
ChkCol = 9

For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value < 6 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
Else
Cells(RowCnt, ChkCol).EntireRow.Hidden = False
End If
Next RowCnt
Application.ScreenUpdating = True
End If
End Sub
--------------------


--
retseort
------------------------------------------------------------------------
retseort's Profile: http://www.excelforum.com/member.php...o&userid=24690
View this thread: http://www.excelforum.com/showthread...hreadid=514023