LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Find error!!!! Is there any other way to do this?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error dialog box meaning and how to find error Jeanne Excel Worksheet Functions 2 September 4th 08 04:59 AM
Find error David Excel Programming 11 July 19th 06 09:31 PM
how to find an error nastech Excel Discussion (Misc queries) 0 July 12th 06 04:59 AM
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
change error message when no more for "find" in macro to find swyltm Excel Programming 1 January 13th 06 05:16 PM


All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"