Call macro from other workbook

  • Thread starter Thread starter pls123
  • Start date Start date
P

pls123

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 !!
 
For Each wb In Workbooks
If ucase(left(wb.name,1) )= "Z" Then
'your code
End if
Next wb
 
hi steve ! ty ! i will test this soon !!

AltaEgo said:
For Each wb In Workbooks
If ucase(left(wb.name,1) )= "Z" Then
'your code
End if
Next wb
 

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