ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to return a list of all selected Sheets in a Workbook (https://www.excelbanter.com/excel-programming/361086-how-return-list-all-selected-sheets-workbook.html)

Felix

How to return a list of all selected Sheets in a Workbook
 
I seem to be unable to return a list of all sheets in a Workbook that are
currently selected by the user. Basically I want to return the Array in

Worksheets(array("x",'y","z")).select

and I 'm having trouble finding a way to return the collection of selected
Worksheet once the are selected by the user.
Any help would be appreciated,

Felix

Jim Thomlinson

How to return a list of all selected Sheets in a Workbook
 
The selected sheets are part of the activewindow. So something like this...

ActiveWindow.SelectedSheets.PrintPreview

--
HTH...

Jim Thomlinson


"Felix" wrote:

I seem to be unable to return a list of all sheets in a Workbook that are
currently selected by the user. Basically I want to return the Array in

Worksheets(array("x",'y","z")).select

and I 'm having trouble finding a way to return the collection of selected
Worksheet once the are selected by the user.
Any help would be appreciated,

Felix


Tom Ogilvy

How to return a list of all selected Sheets in a Workbook
 
for each sh in ActiveWindow.Selectedsheets
msgbox sh.name
Next

--
Regards,
Tom Ogilvy












































"Felix" wrote:

I seem to be unable to return a list of all sheets in a Workbook that are
currently selected by the user. Basically I want to return the Array in

Worksheets(array("x",'y","z")).select

and I 'm having trouble finding a way to return the collection of selected
Worksheet once the are selected by the user.
Any help would be appreciated,

Felix


Felix

How to return a list of all selected Sheets in a Workbook
 
Thank you, worked like a charm

"Tom Ogilvy" wrote:

for each sh in ActiveWindow.Selectedsheets
msgbox sh.name
Next

--
Regards,
Tom Ogilvy












































"Felix" wrote:

I seem to be unable to return a list of all sheets in a Workbook that are
currently selected by the user. Basically I want to return the Array in

Worksheets(array("x",'y","z")).select

and I 'm having trouble finding a way to return the collection of selected
Worksheet once the are selected by the user.
Any help would be appreciated,

Felix



All times are GMT +1. The time now is 05:32 AM.

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