Waiting for Input in a macro

D

dhatul

In a macro I am running, the cursor is required to select a cell 'E1',
where the user is expected to enter some value and once the value is
entered, the macro should execute the remaining lines. However, I am
unable to cause the macro to wait till the input is actually entered
and the macro executes all the lines without waiting for input. Can
someone suggest a solution ?

Range("E1").Select
ActiveCell.FormulaR1C1 = ""
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$51"
ActiveWorkbook.Save
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
 
M

Mark Lincoln

Call up an InputBox to get the needed value. Put that value back into
cell E1 if needed. Look up "inputbox" in VBA Help for more information.
 

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

Top