Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
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 | Excel Discussion (Misc queries) | |||
Long Long Long Nested If Function | Excel Discussion (Misc queries) | |||
THIS IS A GREAT SITE! THANK YOU!!!! | Excel Discussion (Misc queries) | |||
why won't vlookup work in a long list | Excel Worksheet Functions | |||
Great discovery? | Excel Worksheet Functions |