Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
lots of makros into one makro??
Hi! I have a folder with hundreds of xls-files. Each file contains the macro "ALLNUMBERS". Is there a way that I can run all makros without having to open each file and run each makro by hand? THANKS! -- JVLennox ------------------------------------------------------------------------ JVLennox's Profile: http://www.excelforum.com/member.php...o&userid=32505 View this thread: http://www.excelforum.com/showthread...hreadid=567219 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
lots of makros into one makro??
No, the file has to be open for the code to run.
But you could automate the process: <psuedo-code Foldname=get the folder name filename=dir(foldername & "*.xls") 'Or filter as necessary do while filename<"" set WB=workbooks.open(filename) application.run wb.name & "!ALLNUMBERS" wb.close 'true/false if you want to save changes/or not loop <psuedo-code NickHK "JVLennox" wrote in message ... Hi! I have a folder with hundreds of xls-files. Each file contains the macro "ALLNUMBERS". Is there a way that I can run all makros without having to open each file and run each makro by hand? THANKS! -- JVLennox ------------------------------------------------------------------------ JVLennox's Profile: http://www.excelforum.com/member.php...o&userid=32505 View this thread: http://www.excelforum.com/showthread...hreadid=567219 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
lots of makros into one makro??
THANKS, to automate is good enough!! I applied the code, BUT it loops WITHOUT going to the next filename (i always uses the first file in the folder) How do I make it take the next file??? THANKS Code ------------------- Sub START() Foldname = "C:\1\" Filename = Dir(Foldname & "*.xls") 'Or filter as necessary Do While Filename < "" Set wb = Workbooks.Open(Foldname & Filename) 'Application.Run wb.Name & "!ALLNUMBERS" wb.Close 'true/false if you want to save changes/or not Loop End Su ------------------- -- JVLenno ----------------------------------------------------------------------- JVLennox's Profile: http://www.excelforum.com/member.php...fo&userid=3250 View this thread: http://www.excelforum.com/showthread.php?threadid=56721 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
lots of makros into one makro??
I got it! I just have to add this line: Filename = Dir() THANKS anyway! -- JVLenno ----------------------------------------------------------------------- JVLennox's Profile: http://www.excelforum.com/member.php...fo&userid=3250 View this thread: http://www.excelforum.com/showthread.php?threadid=56721 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Makro | New Users to Excel | |||
If with a makro | Excel Discussion (Misc queries) | |||
Makro | Excel Discussion (Misc queries) | |||
Automatic makros in templates Excel 2003 | Excel Programming | |||
Lots of Frustration - Lots of Arrays, Dynamic Ranges Don't Work, Help With Options | Excel Programming |