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.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
oh yes, thats quite easy.

drow a userform with a couple of command buttons .

the code for the commandbuttons is something like

Code:
sub commandbutton1_click
    Sheets("Sheet1").select
End sub

set the userform ShowModal to false and it will sit like a pallet and switch all your windows for you
 
Upvote 0
oh, and to get it to appear automatically...

in the thisworkbook module place this sub

Code:
Sub workbook_open()
    MyMenuUserForm.Show    'use your userform name here
End Sub


and to block the close button on the userform so your menu doesnt disappear...
put this in the userform code module

Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    If CloseMode = 0 Then
        Cancel = True
    End If
End Sub
 
Upvote 0
You can do this simply by right clicking on the navigation bar (bottom left hand corner of your workbook) and clicking on the desired tab (the active tab will have a tick next to its name).
 
Upvote 0
@Trebor76
i think the idea is to hide the tabs and make a pretty menu page...?
 
Upvote 0
@Trebor76
just not good enough :)
 
Upvote 0
nice, mid 20s, bit of cloud.

was up your way sort of on the weekend working at canberra show.. stinking hot one day and blowing and rainy the next. a bit like the pollies.
 
Upvote 0
Thanks. I am very anxious to try this.

You are correct. After 40 years of working on computers, I am amazed by how little I know.
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,710
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