ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Apply Macro on Multiple Worksheets in a Workbook (https://www.excelbanter.com/excel-programming/310969-apply-macro-multiple-worksheets-workbook.html)

Agnes

Apply Macro on Multiple Worksheets in a Workbook
 

Hi Norman,

Thanks for helping! It's a great start, but unfortunately the cod
runs in a loop in the selected worksheet and won't apply the formattin
code to the next worksheet.

Any other ideas?

Thanks a million

--
Agne
-----------------------------------------------------------------------
Agnes's Profile: http://www.excelforum.com/member.php...fo&userid=1463
View this thread: http://www.excelforum.com/showthread.php?threadid=26261


Norman Jones

Apply Macro on Multiple Worksheets in a Workbook
 
Hi Agnes,

To demonstrate that my code operates sequentially on each worksheet, run
this minor adaptation:

Sub Tester()
Dim sh As Worksheet

For Each sh In ActiveWorkbook.Worksheets
MsgBox sh.name
Next sh

End Sub

You may need to adapt your format code to replace activesheet or sheet names
with the variable sh.

If this is a problem, post your code and I will adjust it in this respect.
---
Regards,
Norman



"Agnes" wrote in message
...

Hi Norman,

Thanks for helping! It's a great start, but unfortunately the code
runs in a loop in the selected worksheet and won't apply the formatting
code to the next worksheet.

Any other ideas?

Thanks a million!


--
Agnes
------------------------------------------------------------------------
Agnes's Profile:
http://www.excelforum.com/member.php...o&userid=14630
View this thread: http://www.excelforum.com/showthread...hreadid=262619





All times are GMT +1. The time now is 03:54 AM.

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