Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2007

Tip: Looking for answers? Try searching our database.

How to end my macro in If-else-Endif

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tan - 06 Apr 2007 10:34 GMT
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
Gary''s Student - 06 Apr 2007 10:48 GMT
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

Signature

Gary''s Student - gsnu200713

> Hi All,
>
[quoted text clipped - 17 lines]
>     DONOTHING <----------------------------
> End If
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.