Excel VBA - in a list, if cell equals specific value then I started working on some code, and it works, but I feel like it could be done more effiently. Below is a portion of it to show what I'm doing. To simplify the idea, I've made it here so if the cell in column M is A, B, or C, it puts a 1 in column L. If column M is a D, E, or F, it puts a 2 in column L. And if column M is a G, H, or I, it puts a 3 in column L.

Is there an easier way to do this than how I'm doing it? I'm going to be dealing with a couple hundred possible values. Alex P suggested I build a reference table. I've never done that before, so I'm not sure if that's my best bet or not.

Sub ChangeTest()
    Dim LastRow As Long
    Dim i As Long
    LastRow = Range("M" &amp; Rows.Count).End(xlUp).Row
    For i = 2 To LastRow
        If Range("M" &amp; i).Value = "A" Or Range("M" &amp; i).Value = "B" Or Range("M" &amp; i).Value = "C" Then
        Range("L" &amp; i).Value = "1"
        End If
        If Range("M" &amp; i).Value = "D" Or Range("M" &amp; i).Value = "E" Or Range("M" &amp; i).Value = "F" Then
        Range("L" &amp; i).Value = "2"
        End If
        If Range("M" &amp; i).Value = "G" Or Range("M" &amp; i).Value = "H" Or Range("M" &amp; i).Value = "I" Then
        Range("L" &amp; i).Value = "3"
        End If
    Next i
End Sub
Don't know if it would be faster, but it would look cleaner to use a Select.

Sub ChangeTest()
    Dim LastRow As Long
    Dim i As Long
      LastRow = Range("M" &amp; Rows.Count).End(xlUp).Row
      For i = 2 To LastRow
        Select Case Range("M" &amp; i)
          Case "A", "B", "C"
            Range("L" &amp; i) = "1"
          Case "D","E","F"
            Range("L" &amp; i) = "2"
          Case "G","H","I"
            Range("L" &amp; i) = "3"
        End Select
      Next i
End Sub