I have used this code in the past to hide an entire row if between the Range of F3 to 500 the value is zero. What I’m trying to do is change the range from instead of Rows 3 to 500 TO from Row 3 to the last row of data in Column “C”.
What I have is a worksheet which may have as many as 5000 lines of data in column “C” however Column “F” may only have data in 5 of those lines. Instead of printing a 100 pages which may have no relevant information, I only want to print the rows which have values in column “F”
![]()
Private Sub Workbook_BeforePrint(Cancel As Boolean) For i = 3 To 500 c$ = "F" + CStr(i) If Worksheets("Payment1").Range(c$) = 0 Then Worksheets("Payment1").Range("A" + CStr(i)).EntireRow.Hidden = True End If Next i End Sub
Bookmarks