LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loops are Great as long as they work


Hello people, Is anyone good at looping through workbooks? - im not,

I can perform a simple loop like this;

Dim wb As Workbook
Dim wbs As Workbooks

Set wbs = Application.Workbooks

For Each wb In wbs
MsgBox wb.Name
Next wb

The problem is when I replace the msgbox code with my macro it doesnt
work, or rather the problem is it works on the visible workbook then
fails to loop to any other workbooks.

I know this because my code has some handling error code that gives a
warning if you try and run the macro more than once on the same sheet.

Interestingly, If I have three workbooks open the error messgae will
appear twice indicating that VBA knows how many workbooks are open even
though it doesnt loop through them -

HELP very much appreciated - entire wont fit on here (although most of
it will be irrelevant to problem

Cheers - Greg


--
Turin
------------------------------------------------------------------------
Turin's Profile: http://www.excelforum.com/member.php...o&userid=24987
View this thread: http://www.excelforum.com/showthread...hreadid=466535

 
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
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo Max Loger Excel Discussion (Misc queries) 0 June 14th 11 04:30 PM
Long Long Long Nested If Function sed Excel Discussion (Misc queries) 4 December 9th 09 06:44 PM
THIS IS A GREAT SITE! THANK YOU!!!! Excel User Excel Discussion (Misc queries) 1 August 8th 05 06:38 PM
why won't vlookup work in a long list pkeegs Excel Worksheet Functions 9 August 2nd 05 02:28 PM
Great discovery? David Excel Worksheet Functions 0 May 12th 05 08:25 AM


All times are GMT +1. The time now is 07:13 PM.

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"