input boxes in Excel VBA to ask a user to enter details and save in every cell

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,147
Hello All,

I want vba code. Ask question using Input box and the type answer should place into cell starting from cell a2, b2 and so on..

input box Q.1. Enter ur first name? … answer of this should go in a2.
input box Q.2. Enter ur last name? … answer of this should go in b2.
input box Q.3. Enter ur age? … answer of this should go in c2.
.
.
.
input box Q.10. Enter ur current city name? … answer of this should go in j2.


If suppose user clicked on cancel button on any question of input box, he/she should prompted the same question again until the value not entered.

Pls advise vba code..
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,619
Office Version
  1. 2007
Platform
  1. Windows
A better option would be to use a UserForm, you could add the necessary TextBoxes and until you press a button, the data would go to the sheet:

1588898429098.png
 

Watch MrExcel Video

Forum statistics

Threads
1,128,129
Messages
5,628,869
Members
416,347
Latest member
AT2021

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
Top