P
pano
Hi all
Running this macro from a button on another sheet.
Now comes up with Runtime error 1004
Unable to set the hidden property of the range class?
This code is supposed to check a petrol sheet down one column and if
there is no entry hide that row when it comes to print the monthly
sheet.
Sub Hide_Print_Unhide()
'Petrol Sheet Macro
Dim rw As Long
Application.ScreenUpdating = False
With Sheets("carlog")
.Visible = -1
For rw = 10 To 44
If .Cells(rw, 10).Value = "" Then _
.Rows(rw).Hidden = True ' Here is where it halts
on
Next rw
.PrintPreview ' for testing use .PrintPreview
.Range("j10:j44").EntireRow.Hidden = False
.Visible = -1
End With
Application.ScreenUpdating = True
Worksheets("printMenu").Select
End Sub
Thanks for looking Stephen
Running this macro from a button on another sheet.
Now comes up with Runtime error 1004
Unable to set the hidden property of the range class?
This code is supposed to check a petrol sheet down one column and if
there is no entry hide that row when it comes to print the monthly
sheet.
Sub Hide_Print_Unhide()
'Petrol Sheet Macro
Dim rw As Long
Application.ScreenUpdating = False
With Sheets("carlog")
.Visible = -1
For rw = 10 To 44
If .Cells(rw, 10).Value = "" Then _
.Rows(rw).Hidden = True ' Here is where it halts
on
Next rw
.PrintPreview ' for testing use .PrintPreview
.Range("j10:j44").EntireRow.Hidden = False
.Visible = -1
End With
Application.ScreenUpdating = True
Worksheets("printMenu").Select
End Sub
Thanks for looking Stephen