Selecting non-blank cells

D

Dave

I have a range of cells, only one of which (Variable) contains some text. Is
there a function to return the contents of that cell please.

thanks

Dave P
 
S

smw226 via OfficeKB.com

If you want an actual function then paste this into a module:

Function non_blank_finder(S_range As Range)
For Each cell In S_range
If cell <> "" Then
non_blank_finder = cell
End If
Next cell
End Function

and this into a cell which is not in your range:

=non_blank_finder(your range)

HTH

Simon
 
D

Dave

Hi Simon

Thanks for that it worked fine. I had assumed there would be an existing
function - silly me.

Regards
 
Top