Aloha!
I am trying to create a UserForm that populates a specific row depending on the input.
For example, I input a person's name, employee number, phone number, etc. and a specific housing unit they are assigned to. The row with the respective housing unit is then populated with that person's information.
So far I have used a large if statement,
Code
Private Sub CommandButton1_Click()
Dim emptyRow As Long
Worksheets("List").Activate
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
If HousingNumber = "1001" then
Range("Name1001").Value = Name
Range("Number1001").Value = Number
Range("Gender1001").Value = Gender
ElseIf HousingNumber = "1002" then
Range("Name1002").Value = Name
Range("Number1002").Value = Number
Range("Gender1002").Value = Gender
.
.
.
End Sub
Display More
My problem lies that there are 400 housing units and I am having to manually name a lot of cells so the inputted information is transferred to a respective cell. What is a more efficient way to do this?