Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Unhide the next worksheet
I have 20 hidden worksheets, their names are P1 to P20 I would like to be
able to unhide the next worksheet by the click of a button. For instance if say P1, P2 and P3 were already unhiden then clicking the button would find and unhide the next worksheet P4 in this case and then if clicked again P5 would be unhidden. Can anyone help? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Unhide the next worksheet
This should do it... I assume you can add a button and link it to this
procedure. Sub UnhideNextSheet() Dim wks As Worksheet Dim lngLast As Long lngLast = 0 For Each wks In Worksheets If wks.Visible = xlSheetVisible Then If Left(wks.Name, 1) = "P" And IsNumeric(Mid(wks.Name, 2)) Then If Val(Mid(wks.Name, 2)) lngLast Then _ lngLast = Val(Mid(wks.Name, 2)) End If End If Next wks On Error Resume Next Sheets("P" & lngLast + 1).Visible = xlSheetVisible On Error GoTo 0 End Sub -- HTH... Jim Thomlinson "MarkSussex" wrote: I have 20 hidden worksheets, their names are P1 to P20 I would like to be able to unhide the next worksheet by the click of a button. For instance if say P1, P2 and P3 were already unhiden then clicking the button would find and unhide the next worksheet P4 in this case and then if clicked again P5 would be unhidden. Can anyone help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unhide worksheet IF | Excel Discussion (Misc queries) | |||
unhide a row in a worksheet using vba | Excel Discussion (Misc queries) | |||
How do I unhide the PERSONAL.XLS worksheet? | Excel Worksheet Functions | |||
How do you unhide the first three rows of a worksheet? | Excel Discussion (Misc queries) | |||
how do i unhide a worksheet in excel 2003? unhide tab don't work | Excel Discussion (Misc queries) |