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 |
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 |
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" 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 |
All times are GMT +1. The time now is 02:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com