PC Review


Reply
Thread Tools Rate Thread

Call macro from other workbook

 
 
pls123
Guest
Posts: n/a
 
      30th Apr 2009
hi all !!
i know this command for calling a macro from another workbook..

Application.Run (Macrobook!Macroname)

now..
i need a more complex task..
i need to call the macro "MyMacro" ..
in all the open workbook that have it ..
or , in all the workbooks wich name begins with Z, for example..

...open workbooks change name every week, because i change some, so i cant
correct code evry time, and i need any wild character like *.* doing the work
for me...

is there any way for doing that ?!? that would give to my work right control
of flux. ty !!
 
Reply With Quote
 
 
 
 
AltaEgo
Guest
Posts: n/a
 
      30th Apr 2009
For Each wb In Workbooks
If ucase(left(wb.name,1) )= "Z" Then
'your code
End if
Next wb

--
Steve

"pls123" <(E-Mail Removed)> wrote in message
news:14C4DBF0-5535-4933-9663-(E-Mail Removed)...
> hi all !!
> i know this command for calling a macro from another workbook..
>
> Application.Run (Macrobook!Macroname)
>
> now..
> i need a more complex task..
> i need to call the macro "MyMacro" ..
> in all the open workbook that have it ..
> or , in all the workbooks wich name begins with Z, for example..
>
> ..open workbooks change name every week, because i change some, so i cant
> correct code evry time, and i need any wild character like *.* doing the
> work
> for me...
>
> is there any way for doing that ?!? that would give to my work right
> control
> of flux. ty !!


 
Reply With Quote
 
pls123
Guest
Posts: n/a
 
      30th Apr 2009
hi steve ! ty ! i will test this soon !!

"AltaEgo" wrote:

> For Each wb In Workbooks
> If ucase(left(wb.name,1) )= "Z" Then
> 'your code
> End if
> Next wb
>
> --
> Steve
>
> "pls123" <(E-Mail Removed)> wrote in message
> news:14C4DBF0-5535-4933-9663-(E-Mail Removed)...
> > hi all !!
> > i know this command for calling a macro from another workbook..
> >
> > Application.Run (Macrobook!Macroname)
> >
> > now..
> > i need a more complex task..
> > i need to call the macro "MyMacro" ..
> > in all the open workbook that have it ..
> > or , in all the workbooks wich name begins with Z, for example..
> >
> > ..open workbooks change name every week, because i change some, so i cant
> > correct code evry time, and i need any wild character like *.* doing the
> > work
> > for me...
> >
> > is there any way for doing that ?!? that would give to my work right
> > control
> > of flux. ty !!

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I call up a line of code that references a cell/range in theactive workbook workbook where I am running my macro from? Lav Microsoft Excel Programming 1 11th Nov 2008 05:04 PM
Re: need macro to call a workbook w/o the actual name of the workbook Jon Peltier Microsoft Excel Programming 0 18th Dec 2006 10:01 PM
Call macro stored in Excel workbook from Outlook's macro =?Utf-8?B?R3ZhcmFt?= Microsoft Excel Programming 0 4th Oct 2006 05:47 PM
Call macro stored in Excel workbook from Outlook's macro =?Utf-8?B?R3ZhcmFt?= Microsoft Outlook VBA Programming 5 4th Oct 2006 06:26 AM
How to call macro from other workbook ppyxl Microsoft Excel Programming 8 12th Jul 2006 04:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:04 PM.