Excel Ninja In Training
New Member
- Joined
- May 6, 2011
- Messages
- 25
I'm clearly doing something wrong here; I'd love just a quick note as to what it might be.
Sub AddCategories()
Range("G2").Select
Do
If ActiveCell.Font.Color = 153 Then
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "RMC", 0) > 0 Then
ActiveCell.Offset(0, -3) = "RMC"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "SCP", 0) > 0 Then
ActiveCell.Offset(0, -3) = "SCP"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "TNC", 0) > 0 Then
ActiveCell.Offset(0, -3) = "TNC"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "TER", 0) > 0 Then
ActiveCell.Offset(0, -3) = "TER"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "UMO", 0) > 0 Then
ActiveCell.Offset(0, -3) = "UMO"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "GD", 0) > 0 Then
ActiveCell.Offset(0, -3) = "GD"
ActiveCell.Offset(0, -2) = "WMD"
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell.Offset(0, -6))
End Sub
Sub AddCategories()
Range("G2").Select
Do
If ActiveCell.Font.Color = 153 Then
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "RMC", 0) > 0 Then
ActiveCell.Offset(0, -3) = "RMC"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "SCP", 0) > 0 Then
ActiveCell.Offset(0, -3) = "SCP"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "TNC", 0) > 0 Then
ActiveCell.Offset(0, -3) = "TNC"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "TER", 0) > 0 Then
ActiveCell.Offset(0, -3) = "TER"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "UMO", 0) > 0 Then
ActiveCell.Offset(0, -3) = "UMO"
ActiveCell.Offset(1, 0).Select
ElseIf InStr(1, ActiveCell, "GD", 0) > 0 Then
ActiveCell.Offset(0, -3) = "GD"
ActiveCell.Offset(0, -2) = "WMD"
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell.Offset(0, -6))
End Sub