Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Msgbox
I've been trying to add a yes/no MSgbox to a macro
that when you click yes the macro continues if you click no then the macro stop and ends the macro. I've got to point where the msgbox comes up and if you click yes it keeps going BUT I'm stuck how to tell is to end. Note... I've had no formal training in VB ;-) ' Keyboard Shortcut: Ctrl+Shift+U ' Dim Response As Integer ' Displays a message box with the yes and no options. Response = MsgBox(prompt:="Select 'Yes' or 'No'.", Buttons:=vbYesNo) ' If statement to check if the yes button was selected. If Response = vbYes Then MsgBox "You selected 'Yes'." Else ' The no button was selected. MsgBox "You selected 'No'." End If Range("A2").Select Application.Goto Reference:="R25000C1" ActiveWindow.ScrollRow = 24922 ActiveWindow.ScrollRow = 1 Range("A1:A25000").Select Range("A25000").Activate Selection.AutoFilter Range("A2").Select Application.Goto Reference:="R25000C1" ActiveWindow.ScrollRow = 1 Range("A2:A25000").Select Range("A25000").Activate Selection.AutoFilter Field:=1, Criteria1:="=*--*", Operator:=xlOr, _ Criteria2:="=*personal data*" ActiveWindow.SmallScroll Down:=-132 Selection.EntireRow.Delete blah blah end sub Thanks again Wildman |
#2
|
|||
|
|||
Else
' The no button was selected. MsgBox "You selected 'No'." Exit Sub End If -- Vasant "Wildman" wrote in message ... I've been trying to add a yes/no MSgbox to a macro that when you click yes the macro continues if you click no then the macro stop and ends the macro. I've got to point where the msgbox comes up and if you click yes it keeps going BUT I'm stuck how to tell is to end. Note... I've had no formal training in VB ;-) ' Keyboard Shortcut: Ctrl+Shift+U ' Dim Response As Integer ' Displays a message box with the yes and no options. Response = MsgBox(prompt:="Select 'Yes' or 'No'.", Buttons:=vbYesNo) ' If statement to check if the yes button was selected. If Response = vbYes Then MsgBox "You selected 'Yes'." Else ' The no button was selected. MsgBox "You selected 'No'." End If Range("A2").Select Application.Goto Reference:="R25000C1" ActiveWindow.ScrollRow = 24922 ActiveWindow.ScrollRow = 1 Range("A1:A25000").Select Range("A25000").Activate Selection.AutoFilter Range("A2").Select Application.Goto Reference:="R25000C1" ActiveWindow.ScrollRow = 1 Range("A2:A25000").Select Range("A25000").Activate Selection.AutoFilter Field:=1, Criteria1:="=*--*", Operator:=xlOr, _ Criteria2:="=*personal data*" ActiveWindow.SmallScroll Down:=-132 Selection.EntireRow.Delete blah blah end sub Thanks again Wildman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MsgBox OKCancel | Excel Discussion (Misc queries) | |||
Help with MsgBox... | Excel Worksheet Functions | |||
Problem with array and msgbox | Excel Worksheet Functions | |||
Problem with array and msgbox | Excel Worksheet Functions | |||
Problem with array and msgbox | Excel Worksheet Functions |