I have a set of data that has a column of State abbreviations in it. Each state abbreviation has a corresponding numerical value. I am trying to use looping If/ElseIf to determine the state abbreviation in one column, and based on the value, return the assigned numerical value to the empty cell next to it. With the code below, I get a run-time error 13 Type mismatch with the first IF line highlighted. I've spent most of the day searching for an answer, and the closest that I get is that I have an issue with the text vs. number value and I'm not sure how to solve it.
I have include a sample workbook with the data that I'm referencing.
Code
Sub AuditLimits()
For Each Cell In Range("E2:E2634")
If Cell.Value = "UT" Or "MD" Or "NM" Or "VA" Then
Cell.Offset(0, 1).Val = "6"
ElseIf Cell.Value = "PA" Or "NV" Or "CO" Or "CA" Or "NH" Then
Cell.Offset(0, 1).Value = "9"
ElseIf Cell.Value = "TN" Or "ND" Or "IA" Or "OH" Or "MS" Or "SC" Or "NE" Or "IL" Or "FL" Or "CT" Or "OR" Or "MO" Or "WV" Or "IN" Or "KY" Or "MT" Or "NJ" Or "AZ" Or "NC" Or "AL" Or "ID" Or "DC" Or "WA" Or "ME" Or "RI" Or "LA" Or "TX" Or "MA" Or "NY" Or "DE" Or "KS" Or "MI" Or "MN" Or "GA" Or "HI" Or "OK" Or "SD" Or "AR" Then
Cell.Offset(0, 1).Value = "12"
ElseIf Cell.Value = "AK" Or "VT" Then
Cell.Offset(0, 1).Value = "18"
ElseIf Cell.Value = "EX" Or "GU" Or "WI" Or "PR" Or "WY" Then
Cell.Offset(0, 1).Value = "24"
End If
Next Cell
End Sub
Display More