Modified "For Each wbk In Application.Workbooks"

  • Thread starter Thread starter markx
  • Start date Start date
M

markx

Hello there,

One more "telegraphical" question...

If I want to make changes in all open workbooks, I use something like:

For Each wbk In Application.Workbooks
<do something>
Next wbk

Now, my question is:
how to write the macro that will <do something> on all the open workbooks
except the one from which the macro is executed?

Many thanks for your help on this,
Mark
 
For Each wbk In Application.Workbooks
if wbk.Name <> thisworkbook.Name then
<do something>
end if
Next wbk
 

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