Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
tan tan is offline
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default 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
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
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 10:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 09:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 05:56 PM.

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

About Us

"It's about Microsoft Excel"