Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unhide worksheet IF Marilyn Excel Discussion (Misc queries) 7 April 4th 08 10:35 PM
unhide a row in a worksheet using vba Roxy Excel Discussion (Misc queries) 2 February 1st 08 01:41 AM
How do I unhide the PERSONAL.XLS worksheet? SteveyP66 Excel Worksheet Functions 1 August 9th 06 12:55 PM
How do you unhide the first three rows of a worksheet? jwwj232 Excel Discussion (Misc queries) 7 July 25th 06 02:25 PM
how do i unhide a worksheet in excel 2003? unhide tab don't work mikekeat Excel Discussion (Misc queries) 2 March 6th 06 04:36 AM


All times are GMT +1. The time now is 04:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"