Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Good day,
I have a Code I know I have the right "general" idea.
I know I have the Case and listings correct, but I need the source data to be in "K6" I have Foreign Aircraft in the correct block "H8". I also know I don't need the .end(xlUp). In addition, I would like to input text in "H10" depending what the three letters are. For example "RRR" Royal Air Force would go into "H10", "CFC" would be Canadian Air Force would go into "H10" and so on. Can I have all of this in one macro or should I separate them.
Here is the macro I'm starting with.
I have a Code I know I have the right "general" idea.
I know I have the Case and listings correct, but I need the source data to be in "K6" I have Foreign Aircraft in the correct block "H8". I also know I don't need the .end(xlUp). In addition, I would like to input text in "H10" depending what the three letters are. For example "RRR" Royal Air Force would go into "H10", "CFC" would be Canadian Air Force would go into "H10" and so on. Can I have all of this in one macro or should I separate them.
Here is the macro I'm starting with.
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", "CFC"
ActiveSheet.Range("H8").Value = ActiveSheet.Range("H8").Value & " FOREIGN ACFT"
End Select
Next i
End Sub