Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Case Select
I have the following code:
InitFileName = Range("File").Value & Range("Project").Value & " " & "Insp._ Report," & " " & Format(Report(0, 1), "d-mmm-yy") & ".xls" MsgResult = MsgBox("Have you saved the file?", vbYesNoCancel) Select Case MsgResult Case vbNo FName = Application.GetSaveAsFilename(InitFileName, "Excel File_(*.xls),*.xls") ActiveWorkbook.SaveAs FName, CreateBackup = False Cancel = True Exit Sub Case vbYes ThisWorkbook.Saved = True Application.Quit Case vbCancel Exit Sub End Select End Sub When I select "cancel", the application quit instead of just exiting the sub and going back to the worksheet. Thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Case without Select Case error problem | Excel Discussion (Misc queries) | |||
End Select without Select Case, Block If without End If errors | Excel Programming | |||
For Each with Select Case | Excel Programming | |||
For Each with Select Case | Excel Programming |