LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ray Ray is offline
external usenet poster
 
Posts: 267
Default how to skip to next instance?

I have a 'admin' sheet where the workbook 'owner' can select which
external files to update -- this is done by setting the value in a
specific cell to 'yes' (via Validation). I've built the code to
update the specific file, but need to add code that will test to see
if that file is even available! Here's the code so far:
************
For Each r In Union(Worksheets("ADMIN").Range("c16:c34"),
Worksheets("ADMIN").Range("I16:I33"))
If LCase(r) = "yes" Then
Sto = r.Offset(0, -1).Value
Sto = Format(Sto, "000")

If Dir(Path & "Ops Update_Store" & Sto & ".xls") < "" Then

Else
Call MsgBox("Store " & Sto & " did not submit an update!",
vbExclamation, "Request Denied ....")
End If

Set mybook = Workbooks.Open(Path & "Ops Update_Store" &
Sto & ".xls", 0, True)

...... etc, etc, etc ....
************

You'll notice that I made an attempt to figure it out .... and the
msgbox appears when the file isn't available, BUT then continues on to
try to open the non-existent file, causing an error. I want the code
to display the msgbox and then continue to the next 'r' (if there is
one).

Any ideas?

thanks, ray

 
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
How does one name, for instance, A1 as 'last name?' Rev. Benny New Users to Excel 2 October 14th 08 01:58 PM
First Instance Howard Excel Discussion (Misc queries) 8 March 17th 07 03:05 PM
How do I get one instance of Excel to communicate with another instance? [email protected] Excel Programming 3 November 21st 06 10:31 PM
How do I get rid of a 2nd instance (xls:2)? greenwellies Excel Discussion (Misc queries) 4 April 24th 06 04:44 AM
xl instance tom taol Excel Programming 1 January 29th 05 04:23 PM


All times are GMT +1. The time now is 08:55 AM.

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

About Us

"It's about Microsoft Excel"