Saturday, January 4, 2014

Storing user input value

You might have come across with situation when you wanted to give user an option to input something. An "InputBox" is used to capture this. You can store the user entered value anywhere in the speadsheet.

The code is quite simple as given below:

Sub UserInput()
Sheets("Sheet1").Select
MyInput = InputBox("Enter a number")
Range("A1").Value = MyInput
End Sub

You can add more stuffs in this but I have kept it simple and just one thing at a time. So you can directly copy this code and add it in your module along with other codes.

No comments:

Post a Comment