Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I want to exit a FOR loop if a particular cell's value meets one of the target values and would not want to wait till all conditions are checked. No.of possible target /desired values are 19 and if the cells' value is not equal to any of those 19 then color the cell with a yellow color and increase the count for Nooferrors by one. I just wanted to ask whether the LOGIC in the following loop is correct. ( My syntax seems to be fine as Im able to compile the project without any problem) Please advise. For m = 0 To 18 definedtype = False temp = UCase(Sheets(sheetName).Cells(n, 3)) If reasons(m) = temp Then definedtype = True Exit For End If Next m If definedtype = False Then Sheets(sheetName).Cells(n, 3).Interior.ColorIndex = 6 NoOfErrors = NoOfErrors + 1 End If Regards, Hari India |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If Then Logic | Excel Worksheet Functions | |||
Find loop doesn't loop | Excel Discussion (Misc queries) | |||
IRR Logic | Excel Worksheet Functions | |||
Worksheet_Change - loop within a loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |