ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Selecting non-blank cells (https://www.excelbanter.com/excel-discussion-misc-queries/117158-selecting-non-blank-cells.html)

Dave

Selecting non-blank cells
 
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

smw226 via OfficeKB.com

Selecting non-blank cells
 
Hi Dave,

If you use EditGOTOSpecial and select constants

This should work.

HTH

Simon

Dave wrote:
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


--
--------------------
Simon - UK

Email at simon22mports [ a t ] hot mail [ d ot ]com

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200611/1


smw226 via OfficeKB.com

Selecting non-blank cells
 
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



Dave wrote:
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


--
--------------------
Simon - UK

Email at simon22mports [ a t ] hot mail [ d ot ]com

Message posted via http://www.officekb.com


Dave

Selecting non-blank cells
 
Hi Simon

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

Regards


--
Dave P


"smw226 via OfficeKB.com" wrote:

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



Dave wrote:
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


--
--------------------
Simon - UK

Email at simon22mports [ a t ] hot mail [ d ot ]com

Message posted via http://www.officekb.com




All times are GMT +1. The time now is 10:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com