Run a Macro within a Macro

E

elf27

I've got a public sub that updates information on a specific worksheet called
SyncAESheet. I want to run that macro on each page in the workbook.
Unfortunately, it's only running once (on the current worksheet). What am I
doing wrong?

-------

Public Sub ProcessData()
Dim w As Worksheet
Application.ScreenUpdating = False

For Each w In ActiveWorkbook.Sheets
SyncAESheet
Next


Application.ScreenUpdating = True

End Sub
 
J

Jacob Skaria

You need to activiate the current workbook
Use w.Activate within the loop..
Or pass w as a argument to your subroutine

If this post helps click Yes
 

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

Top