#1   Report Post  
Wildman
 
Posts: n/a
Default 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   Report Post  
Vasant Nanavati
 
Posts: n/a
Default

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
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
MsgBox OKCancel Jasper Excel Discussion (Misc queries) 1 February 23rd 05 10:46 AM
Help with MsgBox... tjb Excel Worksheet Functions 3 December 29th 04 03:43 PM
Problem with array and msgbox aking1987 Excel Worksheet Functions 0 November 1st 04 08:57 AM
Problem with array and msgbox aking1987 Excel Worksheet Functions 1 October 29th 04 01:57 PM
Problem with array and msgbox aking1987 Excel Worksheet Functions 2 October 28th 04 06:20 PM


All times are GMT +1. The time now is 04:56 AM.

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"