Msgbox

W

Wildman

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
 
V

Vasant Nanavati

Else
' The no button was selected.
MsgBox "You selected 'No'."
Exit Sub
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top