ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Call macro from other workbook (https://www.excelbanter.com/excel-programming/427773-call-macro-other-workbook.html)

pls123

Call macro from other workbook
 
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 !!

AltaEgo

Call macro from other workbook
 
For Each wb In Workbooks
If ucase(left(wb.name,1) )= "Z" Then
'your code
End if
Next wb

--
Steve

"pls123" wrote in message
...
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 !!



pls123

Call macro from other workbook
 
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" wrote in message
...
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 !!





All times are GMT +1. The time now is 03:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com