ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Worksheet Selections in Macros (https://www.excelbanter.com/excel-worksheet-functions/42943-re-worksheet-selections-macros.html)

Duke Carey

Worksheet Selections in Macros
 
dim ws as worksheet
for each ws in activeworkbook.worksheets
' you may want to test to see if the worksheet is visible
ws.activate
' put your code here
next ws


"Karen" wrote:

How do you write a VB code to select all worksheets in a file when you don't
know the number of worksheets or the name of the worksheets?

Thanks for any and all help.

Karen



All times are GMT +1. The time now is 11:25 AM.

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