Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings, I have a macro that works great with limited criteria. However, I need it to use a name range if possible for there are about 2500 airport codes that I would need flagged. The listing would need to be NOT equal to the list because there are about 8000 that are equal to. My name range would be Airport_Codes. The current macro I would have to use would be:
As you can see trying to list 8000 codes would be rather silly and a fruitless endeavor. Thank you so much.
VBA Code:
Sub CA_Required()
Dim i As Long
For i = 1 To ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
Select Case Left(ActiveSheet.Cells(i, 1).Value, 3)
Case "MHZ", "LHR", "STR", "RTA"
If ActiveSheet.Range("F" & i) = "" Then
ActiveSheet.Range("F" & i) = "CUST & AG REQ"
Else
ActiveSheet.Range("F" & i) = ActiveSheet.Range("F" & i) & " // CUST & AG REQ"
End If
End Select
Next i
End Sub
As you can see trying to list 8000 codes would be rather silly and a fruitless endeavor. Thank you so much.