Question : Go to Specific Text in Cell

Is there code that will allow me to go to a cell with a specific text?

For example

Cell A1 has "Yellow Cows"

Cell A135 has "Brown Cows", but this could also be Cell A245.

I want to be able to start at Cell A1, and then go to Cell A135 or if its Cell A245, as long as it is the one that has "Brown Cows" and the delete from Cell A1 to A135 or A245, whichever is the case.

Answer : Go to Specific Text in Cell

Update on previous post (first was in error):
use following to delete the rows:
sub DeleteUpToBrown
dim r as integer, rc as integer
  rc=activesheet.usedrange.rows.count
  for r = 1 to rc
    if cells(1,1).value="Brown Cows" then exit for
    cells(1,1).entirerow.delete
  next r
end sub

Use following to clear the contents of the rows
sub ClearUpToBrown
dim r as integer, rc as integer
  rc=activesheet.usedrange.rows.count
  for r = 1 to rc
    if cells(r,1).value="Brown Cows" then exit for
    cells(r,1).entirerow.clearcontents
  next r
end sub


sorry for confusion
Random Solutions  
 
programming4us programming4us