Hi,
The below code is part of a larger routine, but I'm having trouble getting the order correct !
What I want to happen depends on the value of "Flag" For some values it's simply creating a value to be used later. But for some the process needed is more complex.
As you can see (hopefully !) if Flag equals "x" or "SICKR" there are several operations that need to happen for that instance only. However what is happening is that the code is being read as linear whereas I need it to skip to each If statement.
I really really hope that makes sense !!!
The below code is part of a larger routine, but I'm having trouble getting the order correct !
What I want to happen depends on the value of "Flag" For some values it's simply creating a value to be used later. But for some the process needed is more complex.
Code:
Do While Flag <> "" 'look down rows if cells do not equal ""
If Flag = "" Then Exit For
If Flag = "LTS" Then OtherFlag = "Long Term Sick"
If Flag = "SICKR" Then OtherFlag = "Sick on Rest Day"
rowcount = rowcount + 1
Flag = Cells(rowcount, colcount)
If Flag = "x" Then rowcount = rowcount + 1
Flag = Cells(rowcount, colcount)
Loop
As you can see (hopefully !) if Flag equals "x" or "SICKR" there are several operations that need to happen for that instance only. However what is happening is that the code is being read as linear whereas I need it to skip to each If statement.
I really really hope that makes sense !!!