Selecting non-blank cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Hi Simon

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

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top