A Guy Named Robby
New Member
- Joined
- Oct 19, 2016
- Messages
- 25
I have lots of Case Select scenarios set up. I'm going to have to add a lot more. A greatly condensed sample is below. How can I recreate this scenario using a reference table?
Beginning on row 84 to the end of the data, it's comparing what's in column O (college names) to hundreds/thousands of cases. If it finds a match, it enters a specific digit in column N.
Beginning on row 84 to the end of the data, it's comparing what's in column O (college names) to hundreds/thousands of cases. If it finds a match, it enters a specific digit in column N.
Code:
Sub NumberFillIn()
Dim LastRow As Long
Dim i As Long
LastRow = Range("O" & Rows.Count).End(xlUp).Row
For i = 84 To LastRow
Select Case Range("O" & i)
Case "New York University", "NYU", "New York Univ.", "New York Univ"
Range("N" & i) = "1"
Case "Abraham Lincoln University"
Range("N" & i) = "2"
Case "Mississippi College"
Range("N" & i) = "3"
Case "Piedmont College"
Range("N" & i) = "4"
Case "Minnesota State University"
Select Case Range("P" & i)
Case "Bemidji"
Range("N" & i) = "5"
Case "Moorhead"
Range("N" & i) = "6"
Case "St Cloud", "St. Cloud"
Range("N" & i) = "7"
Case "Mankato"
Range("N" & i) = "8"
End Select
End Sub