ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   want all worksheet tabs visible, starting at left (https://www.excelbanter.com/excel-programming/297700-want-all-worksheet-tabs-visible-starting-left.html)

larry mehl

want all worksheet tabs visible, starting at left
 
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

Simon Lloyd[_438_]

want all worksheet tabs visible, starting at left
 
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

--
Message posted from http://www.ExcelForum.com


L Mehl

want all worksheet tabs visible, starting at left
 
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

"Simon Lloyd " wrote in message
...
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.

Simon


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com