ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Exit Sub if sheet is hidden (https://www.excelbanter.com/excel-programming/355335-exit-sub-if-sheet-hidden.html)

ALEX

Exit Sub if sheet is hidden
 
How can I write a line in VBA to Exit Sub if a sheet named PNSheet is hidden?

Thanks

Ardus Petus

Exit Sub if sheet is hidden
 
If not Worksheets(PNSheet).Visible = True then Exit Sub

HTH
--
AP

"Alex" a écrit dans le message de
...
How can I write a line in VBA to Exit Sub if a sheet named PNSheet is

hidden?

Thanks




Bob Phillips[_6_]

Exit Sub if sheet is hidden
 
If Sheets("PNSheet").Visible < xlSheetVisible Then
Exit Sub
End If

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Alex" wrote in message
...
How can I write a line in VBA to Exit Sub if a sheet named PNSheet is

hidden?

Thanks





All times are GMT +1. The time now is 03:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com