Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to find any cell with the word stop in it and turn that
cell red. Later in the code I have all red cells delete. However, it doesn't always work. Sometimes it does other times it doesn't. Typically after I try running the program more than twice it stops working. I've tried doing a step by step debug and it just skips over the code as if the word stop was not in the sheet. My code is as follows: With Worksheets(1).Range("a1:a500") Set c = .Find("Stop", LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do c.Interior.ColorIndex = 3 Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With I tried just deleting the cells within the find but it would do the same thing so I tried it this way hoping because it's a simplier code it would work better but that is not working out. Please help. If there is a way to use a if statement or any other way please let me know. THANKS TO ALL |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error dialog box meaning and how to find error | Excel Worksheet Functions | |||
Find error | Excel Programming | |||
how to find an error | Excel Discussion (Misc queries) | |||
help with this error-Compile error: cant find project or library | Excel Discussion (Misc queries) | |||
change error message when no more for "find" in macro to find | Excel Programming |