Pause a macro after each line, run next after hitting spacebar?

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

Guest

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
 
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
 
Of course, hitting the space bar clicks the OK button,
so this does do what the OP wants ;)
 
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.
 

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