ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Noob Question 3 (https://www.excelbanter.com/excel-programming/398555-noob-question-3-a.html)

O....

Noob Question 3
 
I have a workbook called Vacation Accrued within that workbook I have
Wooksheets for John Doe, Jane Doe, Joe Smith, Suzzie Jones, etc I Want to
execute that code when the Wookbook is open for all Worksheets (John Doe,
Jane Doe, Suzzie Jones and So On.....


JLGWhiz

Noob Question 3
 
This is the basic idea.

Sub myWkbShts()
Dim sh As Worksheet
For Each sh In Workbooks("Vacation Accrued").Sheets
myMacro
Next
End Sub

Sub myMacro()
'Do stuff with John, Jane, Suzy, etc.
End Sub

You use one macro to call each sheet in the workbook and for each sheet you
run the macro that does something to the sheet. It will toggle back and
forth between the two macros until each sheet in the target workbook has been
worked by the macro that makes adjustments to the sheets.

"O...." wrote:

I have a workbook called Vacation Accrued within that workbook I have
Wooksheets for John Doe, Jane Doe, Joe Smith, Suzzie Jones, etc I Want to
execute that code when the Wookbook is open for all Worksheets (John Doe,
Jane Doe, Suzzie Jones and So On.....



All times are GMT +1. The time now is 09:33 AM.

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