LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default hiding sheets using a form

On 14 Dec., 03:51, Roger on Excel
wrote:
i have a spreadsheet with sheets named as follows

St1, St2, St3, St4, St5 etc...

I would like to enter a number into a cell on a separate sheet that will
only show the sheets up to that number and hide the rest.

For example if i enter 3, I would like St1, St2 and St3 to show and the rest
to be hidden.

I am going to use a form to enter the number into the sheet, but for the
moment i need to find code to do the task first.

Can anyone help?


Try this:

Sub Hide_Show_Sheets
SheetNum = ThisWorkbook.Sheets.Count
LastShow = Worksheets("Sheet1").Range("A1").Value

For c = 1 To SheetNum
If c LastShow Then
Sheets("St" & c).Visible = False
Else
Sheets("St" & c).Visible = True

End Sub

Regards Per
 
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
Hiding a Form that's not open kirkm[_6_] Excel Programming 2 March 13th 07 11:02 AM
hiding zero values on all sheets & by default on new sheets WiFiMike2006 Excel Worksheet Functions 4 January 19th 07 08:13 PM
Hiding a form Dan Perkins Excel Programming 4 September 22nd 06 07:40 PM
Locking Sheets / Hiding Sheets Lee Harris Excel Worksheet Functions 4 November 29th 05 07:21 AM
Form not hiding LB79 Excel Discussion (Misc queries) 6 August 24th 05 02:34 PM


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

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

About Us

"It's about Microsoft Excel"