Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListBox click to open a particular sheet in same workbook

Status
Not open for further replies.

sdnt1

Vendor
Jan 29, 2003
4
0
0
US
I am very new to VBA. I have a workbook that has currently over 40-sheets. I have created a Listbox including every sheet. Is it possible to click on a ListBox entry and go to that particular sheet. Just trying to make it easier on the end-user. Maybe there is a better way?
 
You do not need vba to do that. Right-click sheets navigation control in the left-bottom corner.

combo
 

Is there a way hide sheets that are not pertinent to the end user in that view?
 
You can hide sheet via Format > Sheet > Hide.
You can also make sheet 'very hidden' - not to unhide with excel interface. To do it without coding, display VB editor (Tools > Macro > Visual Basic Editor). Click sheet's icon in Project Explorer window, in Properties window set 'Visible' property to 'xlSheetVeryHidden'.
If you need more advanced navigation, you can reserve a part of each page for navigation buttons with assigned macros. The code behind each button, with hidding sheets:
Sheets("NewSheetName").Visible=xlSheetVisible
Sheets("NewSheetName").Activate
Sheets("OldSheetName").Visible=xlSheetHidden ' or =xlSheetVeryHidden

You can navigate workbook with hidden sheet tabs, in this case it is enough to activate sheet.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top