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 Newbie Run Time Error


When using a Dim statement, is there any way to declare a generic value,
so that if there aren't actually 10 workbooks, the macro just ends...or,
how do I get around the run time 1004 error from happening / displaying
alert????

Dim x As Integer
Dim WB As String

For x = 1 To 10


WB = "G:\myFolder\TEST\RBA\RBA " & x & ".xls"
Workbooks.Open Filename:=WB


Next

End Sub


--
have_a_cup
------------------------------------------------------------------------
have_a_cup's Profile: http://www.excelforum.com/member.php...o&userid=35394
View this thread: http://www.excelforum.com/showthread...hreadid=552501

 
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
[NEWBIE] date/time diff Jon Excel Discussion (Misc queries) 4 June 26th 09 10:44 PM
Time Question Newbie Thomas R Grassi Jr New Users to Excel 3 March 27th 07 01:22 AM
Newbie Q: Error handling procedures in a loop KR Excel Programming 2 March 4th 05 05:51 PM
Newbie: Error 1004 Barry Aylett-Warner Excel Programming 6 August 26th 04 05:14 PM
error in my VBA (newbie) Stephanie S Excel Programming 3 September 17th 03 08:25 PM


All times are GMT +1. The time now is 08:51 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"