ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selection.worksheets (https://www.excelbanter.com/excel-programming/330623-selection-worksheets.html)

David

Selection.worksheets
 
I found that the code in the title is not correct. I want to operate on each
worksheet in the selected worksheets.
I tried:
for each wksht in selection.worksheets
code
next wksht
What code should I use?

--
David

Dave Peterson[_5_]

Selection.worksheets
 
Something like this might work ok:

Dim wks As Worksheet
For Each wks In ActiveWindow.SelectedSheets
MsgBox wks.Name
Next wks



David wrote:

I found that the code in the title is not correct. I want to operate on each
worksheet in the selected worksheets.
I tried:
for each wksht in selection.worksheets
code
next wksht
What code should I use?

--
David


--

Dave Peterson

David

Selection.worksheets
 
Thanks David
--
David



All times are GMT +1. The time now is 12:53 AM.

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