Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Modified "For Each wbk In Application.Workbooks"

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Modified "For Each wbk In Application.Workbooks"

For Each wbk In Application.Workbooks
if wbk.Name < thisworkbook.Name then
<do something
end if
Next wbk

--
Regards,
Tom Ogilvy



"markx" wrote:

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Modified "For Each wbk In Application.Workbooks"

Thanks Tom...
Next time I should think more by myself...

"Tom Ogilvy" wrote in message
...
For Each wbk In Application.Workbooks
if wbk.Name < thisworkbook.Name then
<do something
end if
Next wbk

--
Regards,
Tom Ogilvy



"markx" wrote:

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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Multiple "source" workbooks linked to single "destination" workboo DAVEJAY Excel Worksheet Functions 1 September 17th 07 05:33 PM
problem with Linking workbooks via "copy" and "paste link" Arkitek Excel Discussion (Misc queries) 0 December 19th 06 10:03 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
"Subscript out of range" error for: Workbooks("Test1.xls").Save Just12341234 Excel Programming 2 June 17th 05 03:16 PM


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"