Pause macro for input then resume?

drdumont

New Member
Joined
Aug 8, 2007
Messages
12
As powerful as EXCEL is, I am hard put to believe that there is no way to have a macro pause, wait for user input (ended with a carriage return [the ENTER key for you young pups]), then continue the macro.
Simply put, I want the macro to select a cell, wait for input and an [ENTER] then continue the macro from that point. It was so simple in Lotus and Quattro by the use of a (?) in the macro. I've seen many responses elsewhere that it is not possible, but it seems to me to be a very basic function which should not have been left out.
Is there really no way to do this in an Excel macro without seemingly hundreds of lines of code?
Thanks for any input-
-- Doc
 
Last edited:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
what about using an InputBox to insert the user input ?
 
Upvote 0
This will take input from an InputBox. Code execution will wait until the user enters data into the Box

Code:
Dim uiValue as String

Rem some code 

Application.Goto ThisWorkbook.Sheets("Sheet1").Range("C10")

uiValue = Application.InputBox("Enter Something", type:=2)

If uiValue = "False" Then Exit Sub: Rem cancel pressed

ThisWorkbook.Sheets("Sheet1").Range("C10").Value = uiValue

Rem continue on
 
Upvote 0
As powerful as EXCEL is, I am hard put to believe that there is no way to have a macro pause, wait for user input (ended with a carriage return [the ENTER key for you young pups]), then continue the macro.
Simply put, I want the macro to select a cell, wait for input and an [ENTER] then continue the macro from that point. It was so simple in Lotus and Quattro by the use of a (?) in the macro. I've seen many responses elsewhere that it is not possible, but it seems to me to be a very basic function which should not have been left out.
Is there really no way to do this in an Excel macro without seemingly hundreds of lines of code?
Thanks for any input-
-- Doc
how about the inputbox method ?
Code:
Application.InputBox(Prompt:=_
"blah blah blah"), _
Title:="Blah blah dialog box", Type:=8)
 
Last edited:
Upvote 0
Thanks to both of you for the speedy reply. I will play with it and see if I can figure it out.

Again,
Thanks!
 
Upvote 0

Forum statistics

Threads
1,222,752
Messages
6,168,007
Members
452,160
Latest member
Bekerinik

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top