Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings,
The following macro works great, and I only want to reduce the size of it. It was originally to be used if other text were to be included in the target cell. However, now there will always only be one string of text, so the "Else" statement is no longer needed. I could just keep it as it is but I think it would be better to trim down the maco if I can. Thank you very much.
The Macro is:
The following macro works great, and I only want to reduce the size of it. It was originally to be used if other text were to be included in the target cell. However, now there will always only be one string of text, so the "Else" statement is no longer needed. I could just keep it as it is but I think it would be better to trim down the maco if I can. Thank you very much.
The Macro is:
VBA Code:
Sub Foreign_ACFT()
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 "UAF", "RRR", "IFC", "ASY", "LHO", "KAF"
If ActiveSheet.Range("G" & i) = "" Then
ActiveSheet.Range("G" & i) = "FOREIGN"
Else
ActiveSheet.Range("G" & i) = ActiveSheet.Range("G" & i) & "FOREIGN"
End If
End Select
Next i
End Sub