Hi all
I'm stuck with some code. I'm trying to do multiple if's with an else statement but I'm stuck on this. I can't see what's wrong with my code. Basically, it should see if one of the conditions in the cells exists, if not, check the next condition, and if none exist then enter in another value.
Here's my code
Do While ActiveCell <> ""
If ActiveCell.Value = "3000000" Then
ActiveCell.Value = "SP"
If ActiveCell.Value = "3000500" Then
ActiveCell.Value = "CS"
If ActiveCell.Value = "3000600" Then
ActiveCell.Value = "PM"
Else: ActiveCell.Value = "OT"
End If
ActiveCell.Offset(1, 0).Select
Loop
On this I get an error message saying 'loop without do'. I assume I'm missing something simple here but I've not used multiple ifs before in VBA.
I'm stuck with some code. I'm trying to do multiple if's with an else statement but I'm stuck on this. I can't see what's wrong with my code. Basically, it should see if one of the conditions in the cells exists, if not, check the next condition, and if none exist then enter in another value.
Here's my code
Do While ActiveCell <> ""
If ActiveCell.Value = "3000000" Then
ActiveCell.Value = "SP"
If ActiveCell.Value = "3000500" Then
ActiveCell.Value = "CS"
If ActiveCell.Value = "3000600" Then
ActiveCell.Value = "PM"
Else: ActiveCell.Value = "OT"
End If
ActiveCell.Offset(1, 0).Select
Loop
On this I get an error message saying 'loop without do'. I assume I'm missing something simple here but I've not used multiple ifs before in VBA.