Dialouge Box within a Macro

M

maacmaac

How do I create a dialouge box within a Macro. i.e. while a macro is
running, I want the macro to request that the user input a number and
copy it to Cell A1......for example, as the Macro is running, a window
will pop up as follows: "Please enter a number between 1 & 100". What
ever the user types, I want that number to be pasted into cell A1.

Thank you in advance for your comments.
 
G

Gord Dibben

maac

Sub tester()
Range("A1").Value = InputBox("enter a number between 1 & 100")
End Sub

Gord Dibben Excel MVP
 

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