Display message box after each line of code?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
Thank you very much. That does the trick.

Bob Phillips said:
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)
 

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

Back
Top