VBA prompt box to add text to a cell.

garypea123

Board Regular
Joined
Mar 16, 2020
Messages
221
Office Version
  1. 365
Platform
  1. Windows
Good Morning,

I have a VBA running and I would like to create a prompt box where it asks for an input say in Cell C3 for a number (below example is age)

So the VBA should show a message when run to say "Please enter Gary's Age". I then type the number into the prompt box, and this answer goes into C3. Then I do the same for D4 but with the command "Please enter Tom's Age"

The rest of my script will then run as normal based on these results.. :)

Hopefully this makes sense.

Input.PNG
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What about
VBA Code:
Range("C3") = InputBox("Please Enter " & Range("B3") & " Age")
Range("C4") = InputBox("Please Enter " & Range("B4") & " Age")
 
Upvote 0
Solution
Works an absolute dream, makes it look very professional, and such a simple and easy script. Thank you ever so much :)
 
Upvote 0
You are welcome
And thank you for the feedback
Be happy & safe
 
Upvote 0

Forum statistics

Threads
1,214,974
Messages
6,122,536
Members
449,088
Latest member
RandomExceller01

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