Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default controlling worksheets using combo-box

Hi All,

I want to control worksheets using drop-down boxes (combo box).
what I want to do is, I have many worksheets are written in one excel file.
Now I want to use excel sheet as, on first page I am creating one drop down.

This will have lists as a, b, c, ..

and when we will select a from dropbox.. it will make visible the worksheet
with name "a" and other worksheets will be hidden.

Please let me know, if it is possible to accomplish the above task ..

Sunil Sagar
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default controlling worksheets using combo-box

Assuming that you want to use ActiveX type combo box (Selected from the
ActiveX options on the Insert Button on the Developer ribbon in xl2007 or
from the Control Toolbox toolbar in pre xl2007 versions ).

Further I assume that you do not want to hide the mains sheet with the
dropdown combo box.

Create a list of your worksheets somewhere out of the way, preferrably on
the worksheet where you are placing the combo box.
Create the combo box and while in Design Mode, set the List Fill Range to
the range of your worksheet list. (Something like Z1:Z30). Right click the
combo box and select View Code. Insert the following code between the Private
Sub .... and End Sub that appears in the VBA editor. Close the VBA editor and
save the workbook. Don't forget to turn off Design Mode.

Dim ws As Worksheet
Dim strSelectedWS As String

strSelectedWS = ComboBox1.Value

For Each ws In Worksheets
'Edit Sheet1 to the name of your worksheet with the combo box.
If ws.Name = "Sheet1" Or ws.Name = strSelectedWS Then
ws.Visible = xlSheetVisible
Else
ws.Visible = xlSheetHidden
End If
Next ws

--
Regards,

OssieMac


"Sunil Sagar" wrote:

Hi All,

I want to control worksheets using drop-down boxes (combo box).
what I want to do is, I have many worksheets are written in one excel file.
Now I want to use excel sheet as, on first page I am creating one drop down.

This will have lists as a, b, c, ..

and when we will select a from dropbox.. it will make visible the worksheet
with name "a" and other worksheets will be hidden.

Please let me know, if it is possible to accomplish the above task ..

Sunil Sagar

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
combo boxes & protecting worksheets Renee Excel Worksheet Functions 9 March 25th 08 02:49 PM
Is there a key combo to toggle between worksheets? LeaWarner Excel Discussion (Misc queries) 2 February 7th 08 06:46 PM
All Worksheets in a Data Validation combo [email protected] Excel Worksheet Functions 1 November 11th 06 08:58 AM
Controlling Userforms harrysfan New Users to Excel 1 August 30th 06 12:47 PM
Controlling Sequence HS Excel Discussion (Misc queries) 0 March 15th 05 02:15 PM


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