View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default First occurance of text in a column

On Sun, 8 Feb 2009 12:43:46 -0800, "John" wrote:

Column A has the text "Totals" in several random cells. In VBA I would like
2 variables that return the row numbers of the first occurances of "Totals"
in Column A of the rows above and below the active cell, regardless of where
the active cell is. Thank you.



If you have "Totals" in cells A10, A20, A30, and A40, and the active
cell is cell A25 what do you want to have as the result?

A20 and A30 ?
or maybe
A10 and A30 ?

And if the active cell is A30 what do you want to have as the result?

Lars-Åke