Apply Macro on Multiple Worksheets in a Workbook

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top