want all worksheet tabs visible, starting at left

  • Thread starter Thread starter larry mehl
  • Start date Start date
L

larry mehl

I need help with a user interface problem.

The order of the worksheets is:
MainMenu
Its Worksheet_Activate() event says
frmMenuMain.Show
(frmMenuMain contains only buttons to run modules in the application;
cmdCancel hides the menu and displays the Plots tab)
Plots
Data
Instructions
....
At the end of a VBA module which creates a plot, I set focus to the Plots
worksheet with
Sheets("Plots").Select

This also changes the leftmost tab to be the Plots worksheet tab and moves
the MainMenu tab off the screen to the left.

As the code above indicates, showing the MainMenu worksheet (to have its tab
appear as the leftmost tab) displays the form on that worksheet.

Is there some code that will display all tabs starting with MainMenu and
then show the Plots worksheet?

Thanks for any help.

Larry Mehl
 
Sheets("Sheet1").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Sheet1", "sheet2", "sheet3", "sheet 4", _
"sheet5", "sheet6", "sheet7")).Select
Sheets("sheet1").Activate

This selects all sheets (1-7)

dont know if this is what you want but its half way there.

Simo
 
Simon --

Thanks for responding.

Using my worksheet names, your suggested code becomes:

If your "Sheet1" represents my "MainMenu" (contains the form requiring user
click of a button),
Sheets("Sheet1").Select
opens "MainMenu", which, in turn, waits for user input, so that the
remaining lines of code don't execute.

ActiveWindow.ScrollWorkbookTabs Position:=xlLast
scrolls the set of worksheet tabs to the right

Sheets(Array( _ ... highlights all the worksheet tabe

If I eliminate
Sheets("Sheet1").Select

the code
opens "MainMenu", which, in turn, waits for user input
If I click cmdCancel on that form,I get the result I want ... MainMenu tab
appearing at the left.

Is there a way in code to "click" a button on the form on the active sheet?

Larry
 
Back
Top