Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook Loop Headache
Hello all, I have an issue which no matter what I try I can't resolve. In my accounts departments we download up to 80 reports every month end. I have a macro which formats each one into its correct format with dates and titles etc. This works perfectly and I dont think I really need to post it here. When I try to add code to this which would make it loop through all the workbooks I have open it fails - no matter what I try. If I did wach workbook individually it work every time. Does anyone know of any code that would loop my macro though all open workbooks in excel??? Any help - much appreciated, although I have tried most of the techniques I have found in help sites etc, I think I may be making a stupid oversight although I have no code left to show you what I did in the first place. Cheers Greg -- Turin ------------------------------------------------------------------------ Turin's Profile: http://www.excelforum.com/member.php...o&userid=24987 View this thread: http://www.excelforum.com/showthread...hreadid=398341 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook Loop Headache
Turin
What do you mean by "fail". If you get an error, post what error you get. You're probably trying to do something to a workbook that you can't do because it's an Add-in or a hidden workbook. This may alleviate your problems Dim wb As Workbook For Each wb In Application.Workbooks If wb.Visible = True 'Do stuff End If Next wb -- Dick Kusleika Excel MVP Daily Dose of Excel www.dicks-blog.com Turin wrote: Hello all, I have an issue which no matter what I try I can't resolve. In my accounts departments we download up to 80 reports every month end. I have a macro which formats each one into its correct format with dates and titles etc. This works perfectly and I dont think I really need to post it here. When I try to add code to this which would make it loop through all the workbooks I have open it fails - no matter what I try. If I did wach workbook individually it work every time. Does anyone know of any code that would loop my macro though all open workbooks in excel??? Any help - much appreciated, although I have tried most of the techniques I have found in help sites etc, I think I may be making a stupid oversight although I have no code left to show you what I did in the first place. Cheers Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Frequency Headache | Excel Worksheet Functions | |||
Vlookup Headache | Excel Worksheet Functions | |||
Hyperlink Headache | Excel Programming | |||
Code to Loop thru a Workbook | Excel Programming | |||
Look up Headache | Excel Programming |