Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just a variant:
Sub test() Dim sh As Worksheet On Error Resume Next For Each sh in ThisWorkbook.Worksheets With sh .Visible = Left(LCase(.Name), 2) = "ne" End With Next sh On Error GoTo 0 End Sub The "On Error Resume Next" is just in case there are no sheets starting with "ne" - which would cause the last worksheet to throw a run-time error since a workbook has to have at least one visible sheet. In article , "Ron de Bruin" wrote: Hi Brentus Try something like this This will only show the sheets with a name that starts with "ne" or "NE" Sub test() Dim sh As Worksheet For Each sh In ThisWorkbook.Worksheets If Left(LCase(sh.Name), 2) = "ne" Then sh.Visible = xlSheetVisible Else sh.Visible = xlSheetHidden End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
dropdown to show only part of data sheet | Excel Discussion (Misc queries) | |||
Name of the sheet - hide and show | Excel Discussion (Misc queries) | |||
show only the required part of the sheet | New Users to Excel | |||
Showing + and - (show and hide) for rows in the sheet | Excel Worksheet Functions | |||
Show Form, Hide all Sheets | Excel Programming |