View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default 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" wrote in message
...
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