Input box help

Coppa

New Member
Joined
Mar 17, 2011
Messages
13
Any help here would be greatly appreciated!

I have a list of numbers (1-> x in order) , Names, and each name is associated with a region, (Region 1,2,3 or 4).

So my data is structured as

1 Bob Region 1
2 Mary Region 2
3 Mark Region 1
etc

I would like to add an input box which asks
"What is the new students name" <to be typed in>
"Which region do they come from" <to be selected from the limited list of regions>

This would then get added to the bottom of the table including the additional number , i.e in my little example above

4 John Region 2

Any help is much appreciated. Thanks
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try

Code:
Sub AddData()
Dim X, s As String, LR As Long
s = InputBox("Enter name and region separated by comma", "Data entry", "John,1")
If s = "" Then Exit Sub
X = Split(s, ",")
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("A" & LR + 1)
    .Value = .Offset(-1).Value + 1
    .Offset(, 1).Value = X(0)
    .Offset(, 2).Value = "Region " & X(1)
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,248
Members
452,900
Latest member
LisaGo

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