I'm using the following code to hide rows if the column F is empty and open the print dialogue. The code works fine if the last row(column F37 is empty) but if F37 is filled with data I get the debug message.
How may I prevent this? I have formulas in column H,K,M & O
Any help on this would be kindly appreciated.
Code: Select all
Sub PrintDialogByHidingEmptyRows()
Application.ScreenUpdating = False
Worksheets("MySheet").Range("F18:F37").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True
Application.Dialogs(xlDialogPrint).Show
Application.ScreenUpdating = True
End Sub