Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want the following macro to stop after each line and wait for me to hit the
spacebar before entering the next line. What code do I need to add? 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is no way to pause a macro and wait for a keypress. The
only thing you can do is display a MsgBox after each line of code and let the user click OK. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "manxman" wrote in message ... I want the following macro to stop after each line and wait for me to hit the spacebar before entering the next line. What code do I need to add? 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Of course, hitting the space bar clicks the OK button,
so this does do what the OP wants ;) Chip Pearson wrote: There is no way to pause a macro and wait for a keypress. The only thing you can do is display a MsgBox after each line of code and let the user click OK. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "manxman" wrote in message ... I want the following macro to stop after each line and wait for me to hit the spacebar before entering the next line. What code do I need to add? 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That sounds like it would be fine. How do you suggest I proceed to make this
as simple as possible? Thanks very much for your help. "Chip Pearson" wrote: There is no way to pause a macro and wait for a keypress. The only thing you can do is display a MsgBox after each line of code and let the user click OK. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "manxman" wrote in message ... I want the following macro to stop after each line and wait for me to hit the spacebar before entering the next line. What code do I need to add? 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I create a new line in a cell in Excel by hitting enter? | Excel Discussion (Misc queries) | |||
hitting spacebar in excel deletes last character entered. | New Users to Excel | |||
Pause a Macro? | Excel Programming | |||
excel macro - macro initiation upon hitting the ener key | Excel Programming | |||
Pause during a Macro | Excel Programming |