Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.newusers
|
|||
|
|||
How to end my macro in If-else-Endif
Hi All,
I have wrote a msgbox with vbYesNo. But encounter the problem of how to exit this macro if end user click No on my msgbox. Please advice me on what should i substitute 'DoNothing' in my macro below. Thanks. If Response = vbYes Then ' User chose Yes. Call Unhide_xlVeryHidden_All_Sheets Sheets("Login").Select Sheets("Login").Range("S1") = "" ActiveWorkbook.Save ActiveSheet.Move After:=Sheets(Sheets.Count) For Each oSheet In Sheets oSheet.Visible = xlVeryHidden Next Else ' User chose No. DONOTHING <---------------------------- End If |
#2
Posted to microsoft.public.excel.newusers
|
|||
|
|||
How to end my macro in If-else-Endif
If Response = vbYes Then ' User chose Yes.
Call Unhide_xlVeryHidden_All_Sheets Sheets("Login").Select Sheets("Login").Range("S1") = "" ActiveWorkbook.Save ActiveSheet.Move After:=Sheets(Sheets.Count) For Each oSheet In Sheets oSheet.Visible = xlVeryHidden Next Else ' User chose No. Exit Sub End If -- Gary''s Student - gsnu200713 "Tan" wrote: Hi All, I have wrote a msgbox with vbYesNo. But encounter the problem of how to exit this macro if end user click No on my msgbox. Please advice me on what should i substitute 'DoNothing' in my macro below. Thanks. If Response = vbYes Then ' User chose Yes. Call Unhide_xlVeryHidden_All_Sheets Sheets("Login").Select Sheets("Login").Range("S1") = "" ActiveWorkbook.Save ActiveSheet.Move After:=Sheets(Sheets.Count) For Each oSheet In Sheets oSheet.Visible = xlVeryHidden Next Else ' User chose No. DONOTHING <---------------------------- End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |