Question : Excel: Macro to load tabs based on cell data

I have a worksheet set for processing equipment.  Trucks, trailers and containers.  
However I want different tabs to load based on either truck, trailers, or containers.  

User will choose by drop down list, and will click a macro button to initiate the macro and load the tabs.

Im stuck though, I cant figure out how to run it and load a different tab per cell value.  Any help is appreciated!

Answer : Excel: Macro to load tabs based on cell data

If you have the separate tabs already in the workbook, then you can hide and unhide the tabs based on the selection.

In the macro just set the Visible property of each sheet accordingly.

Something along the lines of:

If you post your macro or the workbook it would be easier to provide more in depth help, but this should get you on the right track.

WC
1:
2:
3:
4:
5:
6:
7:
8:
'First hide all the sheets
Sheets("Trucks").Visible = False
Sheets("Trailers").Visible = False
Sheets("Containers").Visible = False
 
'Show the tab that was selected in your dropdown
'choice is the value of your listbox or cell where the dropdown is, assuming the dropdown uses the tab names
Sheets(choice).Visible = True
Open in New Window Select All
Random Solutions  
 
programming4us programming4us