+ Reply to Thread
Results 1 to 2 of 2

Msgbox

  1. #1
    Wildman
    Guest

    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. #2
    Vasant Nanavati
    Guest

    Re: Msgbox

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

    --

    Vasant


    "Wildman" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1