ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro fundamentals (https://www.excelbanter.com/excel-programming/381739-re-macro-fundamentals.html)

Ken Johnson

Macro fundamentals
 

Brad wrote:
I have a worksheet that I want to hide all the tabs other than "Policy
information"
What is wrong with the below code. The macro doesn't seem to recognize the
line

If sheet.Name < "Policy information" Then

correctly


Sub visible_sheets()
Dim sheet As Worksheet
For Each sheet In Worksheets
If sheet.Name < "Policy information" Then
Sheets.Visible = False
End If
Next
End Sub


Get rid of that s..

Sheet.Visible = False NOT Sheets.Visible = False

Ken Johnson



All times are GMT +1. The time now is 06:16 AM.

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