+ Reply to Thread
Results 1 to 3 of 3

Display message box after each line of code?

  1. #1
    manxman
    Guest

    Display message box after each line of code?

    How would I call for a message box to be displayed after each line of code in
    the macro below? The purpose is only to halt the macro until I tell it to
    proceed to the next line.

    Sub Optimize()
    '
    ' Optimize Macro
    ' Run through series of percentages
    '
    ' Keyboard Shortcut: Ctrl+Shift+O
    '
    Application.Run "PERSONAL.XLS!MoveCursorNot"
    ActiveCell.FormulaR1C1 = "0.0001"
    ActiveCell.FormulaR1C1 = "0.0002"
    ActiveCell.FormulaR1C1 = "0.0003"
    ActiveCell.FormulaR1C1 = "0.0004"
    ActiveCell.FormulaR1C1 = "0.0005"
    End Sub

  2. #2
    Bob Phillips
    Guest

    Re: Display message box after each line of code?

    Sub Optimize()
    '
    ' Optimize Macro
    ' Run through series of percentages
    '
    ' Keyboard Shortcut: Ctrl+Shift+O
    '
    Application.Run "PERSONAL.XLS!MoveCursorNot"
    Msgbox "Hit any key to continue"
    ActiveCell.FormulaR1C1 = "0.0001"
    Msgbox "Hit any key to continue"
    ActiveCell.FormulaR1C1 = "0.0002"
    Msgbox "Hit any key to continue"
    ActiveCell.FormulaR1C1 = "0.0003"
    Msgbox "Hit any key to continue"
    ActiveCell.FormulaR1C1 = "0.0004"
    Msgbox "Hit any key to continue"
    ActiveCell.FormulaR1C1 = "0.0005"
    End Sub

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "manxman" <[email protected]> wrote in message
    news:[email protected]...
    > How would I call for a message box to be displayed after each line of code

    in
    > the macro below? The purpose is only to halt the macro until I tell it to
    > proceed to the next line.
    >
    > Sub Optimize()
    > '
    > ' Optimize Macro
    > ' Run through series of percentages
    > '
    > ' Keyboard Shortcut: Ctrl+Shift+O
    > '
    > Application.Run "PERSONAL.XLS!MoveCursorNot"
    > ActiveCell.FormulaR1C1 = "0.0001"
    > ActiveCell.FormulaR1C1 = "0.0002"
    > ActiveCell.FormulaR1C1 = "0.0003"
    > ActiveCell.FormulaR1C1 = "0.0004"
    > ActiveCell.FormulaR1C1 = "0.0005"
    > End Sub




  3. #3
    manxman
    Guest

    Re: Display message box after each line of code?

    Thank you very much. That does the trick.

    "Bob Phillips" wrote:

    > Sub Optimize()
    > '
    > ' Optimize Macro
    > ' Run through series of percentages
    > '
    > ' Keyboard Shortcut: Ctrl+Shift+O
    > '
    > Application.Run "PERSONAL.XLS!MoveCursorNot"
    > Msgbox "Hit any key to continue"
    > ActiveCell.FormulaR1C1 = "0.0001"
    > Msgbox "Hit any key to continue"
    > ActiveCell.FormulaR1C1 = "0.0002"
    > Msgbox "Hit any key to continue"
    > ActiveCell.FormulaR1C1 = "0.0003"
    > Msgbox "Hit any key to continue"
    > ActiveCell.FormulaR1C1 = "0.0004"
    > Msgbox "Hit any key to continue"
    > ActiveCell.FormulaR1C1 = "0.0005"
    > End Sub
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove nothere from email address if mailing direct)
    >
    > "manxman" <[email protected]> wrote in message
    > news:[email protected]...
    > > How would I call for a message box to be displayed after each line of code

    > in
    > > the macro below? The purpose is only to halt the macro until I tell it to
    > > proceed to the next line.
    > >
    > > Sub Optimize()
    > > '
    > > ' Optimize Macro
    > > ' Run through series of percentages
    > > '
    > > ' Keyboard Shortcut: Ctrl+Shift+O
    > > '
    > > Application.Run "PERSONAL.XLS!MoveCursorNot"
    > > ActiveCell.FormulaR1C1 = "0.0001"
    > > ActiveCell.FormulaR1C1 = "0.0002"
    > > ActiveCell.FormulaR1C1 = "0.0003"
    > > ActiveCell.FormulaR1C1 = "0.0004"
    > > ActiveCell.FormulaR1C1 = "0.0005"
    > > End Sub

    >
    >
    >


+ 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