Ananthak275
Board Regular
- Joined
- Aug 22, 2020
- Messages
- 128
- Office Version
- 2013
- Platform
- Windows
- MacOS
I'm having trouble creating a macro that accomplishes the following things:
1. If any value within the string has "progress" then the status should be set to 1 and end the loop.
2. If all the values in the range are either "done" or NULL or EMPTY then the status should set to 0 and end the loop.
3. If all the values in the range are either "starting" then the status should set to 2 and end the loop.
How do I differentiate between the two (check if the values are either all "done" or "starting" or any if the values have "progress" in it?
1. If any value within the string has "progress" then the status should be set to 1 and end the loop.
2. If all the values in the range are either "done" or NULL or EMPTY then the status should set to 0 and end the loop.
3. If all the values in the range are either "starting" then the status should set to 2 and end the loop.
How do I differentiate between the two (check if the values are either all "done" or "starting" or any if the values have "progress" in it?
PC_Question = "A"
StartRow = 2
TC = "B"
endrow = "19"
Rng = Range(PC_Question & StartRow & ":" & TC & endrow).Value
For Each cel In Rng
if (instr(1.cel.value, "done" or NULL OR EMPTY) then
Status=0
if (instr(1.cel.value, "starting") then
Status=1
if (instr(1.cel.value, "progress") then
Status=2