#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default DisplayedText?

Hi,

Is there no function (Excel 2002) to return the Text() of another cell, as
it is displayed?
For example, if I had a formula =DisplayedText(Data!A1), I would want it to
return:
"" if Data!A1 is blank
"" if Data!A1=0 and Zeros are not displayed on Data
"0" if Data!A1=0 and Zeros are displayed on Data
"z1" if Data!A1=1 and its format = zGeneral
etc.

I thought =Text(Data!A1,Cell("format",Data!A1)) would do it, but tried and
discovered otherwise. I'm sure a user defined function could be programmed
for this but it sure seems like it would already be built in.

Thank you,
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default DisplayedText?

James,

It isn't built-in. But the User-Definded-Function, below, will do what you want.

Function DisplayedText(myCell As Range) As String
DisplayedText = myCell.Text
End Function

Use it as in your example:

=DisplayedText(Data!A1)

HTH,
Bernie
MS Excel MVP



"James Allen" <JamesA~AA~mwengrs~DD~com wrote in message
...
Hi,

Is there no function (Excel 2002) to return the Text() of another cell, as it is displayed?
For example, if I had a formula =DisplayedText(Data!A1), I would want it to return:
"" if Data!A1 is blank
"" if Data!A1=0 and Zeros are not displayed on Data
"0" if Data!A1=0 and Zeros are displayed on Data
"z1" if Data!A1=1 and its format = zGeneral
etc.

I thought =Text(Data!A1,Cell("format",Data!A1)) would do it, but tried and discovered otherwise.
I'm sure a user defined function could be programmed for this but it sure seems like it would
already be built in.

Thank you,
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO





  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default DisplayedText?

That will work. Thank you Bernie.
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
James,

It isn't built-in. But the User-Definded-Function, below, will do what
you want.

Function DisplayedText(myCell As Range) As String
DisplayedText = myCell.Text
End Function

Use it as in your example:

=DisplayedText(Data!A1)

HTH,
Bernie
MS Excel MVP

<snip


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"