Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
On Error GoTo skip needs help
"Subscript out of range" appeared when a non existant file was entered,
and the execution was aborted. Can you help me to continue the execution? Sub Analyse() Dim Ans As Variant Dim filename As String Sheets("Sheet1").Select Ans = InputBox(prompt:="Enter the data file name. ") If Ans = "" Then Exit Sub filename = Ans & ".csv" On Error GoTo skip Workbooks.Open filename:="F:\Cabinet1\" & filename, UpdateLinks:=0 ' Main analysis body here Exit Sub skip: Windows("ABC").Activate Sheets("Sheet1").Range("H1") = Ans & " file does not exist!" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Skip a cell that contains data | Excel Worksheet Functions | |||
Cond Format:re color 2 cols, skip 2 cols | Excel Worksheet Functions | |||
How do I skip blank cells when copying over a range of cells? | Excel Discussion (Misc queries) | |||
Even after selecting "skip blanks" in the paste special menu in e. | Excel Discussion (Misc queries) | |||
Skip the holidays | Excel Discussion (Misc queries) |