PDA

View Full Version : SOLVED: Run macro all all open workbooks with one exception



RobertHT
02-18-2009, 05:34 PM
Hi I'm still pretty new to VBA,

I would like to run a macro on all open workbooks with the exception of one (which is the workbook i have my macros stored on). Could anyone help thanks

RobertHT
02-18-2009, 06:00 PM
sorted...

Kenneth Hobs
02-18-2009, 06:22 PM
What does sorted mean?

Depends on what you macro will do. Maybe something like:
Sub RunMyMac()
Dim wb As Workbook
For Each wb In Workbooks
If wb.Name <> ThisWorkbook.Name Then
wb.Activate
MyMac
End If
Next wb
End Sub

RobertHT
02-18-2009, 07:35 PM
hey ken,

thanks for that. How do i change the thread to solved?

GTO
02-18-2009, 10:10 PM
Greetings Robert,

Above your first post, click the button "Thread Tools" and Marked Solve is available to the original poster.

Have a great day,

Mark