View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
barnabel barnabel is offline
external usenet poster
 
Posts: 119
Default Finding text in a selection

Is your range multiple columns, multiple rows, both?

You can loop from range.row to range.row+range.rows.count and from range
..column to range.column+range.columns.count

Hope that helps some.

Peter Richardson

"Steve C" wrote:

What would be the most efficient way using programming code to find all
instances of a text phrase within a selected range of cells? I'm using an
Inputbox to capture the text to search for, and when the text is found, run
whatever code I want, then find the next occurance, run my code, etc. After
it's found the last occurance, stop.

I'm finding that my code wants to keep going back to the start and
continuously looping (I'm using a "For Each ItemFound in Selection" approach
unsuccessfully so far). Thanks for any suggestions!
--
Steve C