Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying worksheets


I have a workbook with 97 worksheets. I would like the user, using
userform, to decide which sheets they would like to look at. Eac
worksheet has an 8 letter name that describes (to the user and myself
the content of the worksheet.

I have successfully created a macro that allows 4 display options
however I am having trouble breaking it down further.

For example, lets say I have new & used car lots in Washington
Oregon. ( I have a few more variables than this)

I can separate the displays so that the User can look at only new ca
lots or used car lots. But if they want to limit the display further
for example, to display Used lots in Oregon I get a run time erro
#1004 "Select Method of Worksheet Class failure"

I have used the code below successfully before but now I get this erro
when the macro arrives at Activesheet.Next.Select is it because some o
the sheets are hidden?

Sheets("Control").Select
ActiveSheet.Next.Select
For i = 1 To (Sheets.Count - 1)

Jam = ActiveSheet.Name
Jelly = Mid(Jam, 1, 2)
Branch = Mid(BR_Optioncode, j, 2)
If Jelly = Branch Then
Sheets(Jam).Visible = True
ElseIf Jelly < Branch Then
Sheets(Jam).Visible = False
End If
ActiveSheet.Next.Select
On Error Resume Next

Next i

Thanks for your help

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Displaying worksheets

Sheets("Control").Select
For each sh in Sheets
Jam = sh.Name
Jelly = Mid(Jam, 1, 2)
Branch = Mid(BR_Optioncode, j, 2)
If Jelly = Branch Then
Sheets(Jam).Visible = True
Else
Sheets(Jam).Visible = False
End If
Next Sh

--
Regards,
Tom Ogilvy



"rduke0" wrote in message
...

I have a workbook with 97 worksheets. I would like the user, using a
userform, to decide which sheets they would like to look at. Each
worksheet has an 8 letter name that describes (to the user and myself)
the content of the worksheet.

I have successfully created a macro that allows 4 display options;
however I am having trouble breaking it down further.

For example, lets say I have new & used car lots in Washington &
Oregon. ( I have a few more variables than this)

I can separate the displays so that the User can look at only new car
lots or used car lots. But if they want to limit the display further,
for example, to display Used lots in Oregon I get a run time error
#1004 "Select Method of Worksheet Class failure"

I have used the code below successfully before but now I get this error
when the macro arrives at Activesheet.Next.Select is it because some of
the sheets are hidden?

Sheets("Control").Select
ActiveSheet.Next.Select
For i = 1 To (Sheets.Count - 1)

Jam = ActiveSheet.Name
Jelly = Mid(Jam, 1, 2)
Branch = Mid(BR_Optioncode, j, 2)
If Jelly = Branch Then
Sheets(Jam).Visible = True
ElseIf Jelly < Branch Then
Sheets(Jam).Visible = False
End If
ActiveSheet.Next.Select
On Error Resume Next

Next i

Thanks for your help.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements


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
Displaying numerous charts evenly in various worksheets Dawn Montella Charts and Charting in Excel 1 November 20th 09 02:13 PM
Displaying a zero Tommy Kramer 9[_2_] Excel Discussion (Misc queries) 3 January 15th 08 10:46 PM
Not displaying a value KB Excel Discussion (Misc queries) 3 May 17th 07 08:54 PM
Displaying a different value Mac Excel Discussion (Misc queries) 8 February 2nd 06 01:09 PM
Displaying #N/A as a zero kosciosco Excel Worksheet Functions 2 November 23rd 04 11:51 AM


All times are GMT +1. The time now is 10:36 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"