Using Userform to switch between worksheets

hernandj

Board Regular
Joined
Aug 19, 2004
Messages
60
Is it possible to use a VBA user form to switch between worksheets. I would like to use a VBA userform as a menu selector. The user would make a selection from a list box and a sheet would be opened. When that sheet is closed, the list box would be displayed for the next worksheet selection.

Can this be done? If so, is there an example available?

Thanks in advance for your help.
 
@Trebor76
i think the idea is to hide the tabs and make a pretty menu page...?

Hello diddi,
I'm working on an admin system and the idea is to hide the tabs and make a menu page.
I'm using Excel 2007. What would be the code to hide the tabs and get a non-excel look?

Thanks in advance.
 
Upvote 0

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
hi javles and welcome to the board.
the best way to remove the excel look and make your own apps is to use all your own userforms to interact with the user.
once your project is to that stage, then hide excel
 
Upvote 0
Thanks for your reply!

My userform is ready and added some command buttons to switch between worksheets.
The code for the buttons is the one I found in this thread

Code:
Private Sub CommandButton1_Click()
Sheets("List").Select
End Sub

I'm getting this error when I hit run and click the button,
Run-time error 9:
Subscript out of range
 
Upvote 0
Hi javles,

List must not be the exact name of the tab. Check for leading or trailing spaces and try again.

Robert
 
Upvote 0
if you want to remove the excel look, you cannot design the forms on sheets. do you know how to create a userform?
 
Upvote 0
Ï was able to resolve it. Thanks for your help @diddi.

The correct code was:
Code:
Sheets(1).Select

And I did create a userform. Everything is working fine.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,723
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top