Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frequency Headache Rothman Excel Worksheet Functions 6 March 9th 06 09:25 PM
Vlookup Headache Stressed Out!! Excel Worksheet Functions 1 September 14th 05 06:03 AM
Hyperlink Headache Fowler_ko[_2_] Excel Programming 0 November 16th 04 09:26 AM
Code to Loop thru a Workbook Leo Excel Programming 3 May 20th 04 10:08 PM
Look up Headache Chris Excel Programming 3 November 26th 03 02:55 PM


All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"