Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MDW MDW is offline
external usenet poster
 
Posts: 117
Default Get Displayed Value Of a Cell

I'm trying to write a function that does the same thing as the "precision as
displayed" setting, but only for a certain range (the selected cells). Is
there any way to get at the displayed value of a cell? I think that will help
me accomplish what I want.

For instance, if the ACTUAL value of a cell is 76.5, but it's showing 77 on
the worksheet, I want to make the value of that cell 77.

Or, if the value of a cell is 13.362145, but it's showing 13.36, I want to
make the value of that cell 13.36.

Only, I don't want to do this for the entire sheet, just the selected range.
I'm thinking that if I create a custom function that says

For Each objC In Application.Selection.Cells

objC.Value = objC.DisplayedValue

Next

Only, I can't seem to find what that "displayed value" property is.

Any help would be great. Thanks.

--
Hmm...they have the Internet on COMPUTERS now!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Get Displayed Value Of a Cell

Msgbox Range("A1").Text

or, in your example:

For Each objC In Selection
objC.Value = objC.Text
Next


Regards

Trevor


"MDW" wrote in message
...
I'm trying to write a function that does the same thing as the "precision
as
displayed" setting, but only for a certain range (the selected cells). Is
there any way to get at the displayed value of a cell? I think that will
help
me accomplish what I want.

For instance, if the ACTUAL value of a cell is 76.5, but it's showing 77
on
the worksheet, I want to make the value of that cell 77.

Or, if the value of a cell is 13.362145, but it's showing 13.36, I want to
make the value of that cell 13.36.

Only, I don't want to do this for the entire sheet, just the selected
range.
I'm thinking that if I create a custom function that says

For Each objC In Application.Selection.Cells

objC.Value = objC.DisplayedValue

Next

Only, I can't seem to find what that "displayed value" property is.

Any help would be great. Thanks.

--
Hmm...they have the Internet on COMPUTERS now!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Get Displayed Value Of a Cell

Range("A1").Text

is what you want as against .Value.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"MDW" wrote in message
...
I'm trying to write a function that does the same thing as the "precision

as
displayed" setting, but only for a certain range (the selected cells). Is
there any way to get at the displayed value of a cell? I think that will

help
me accomplish what I want.

For instance, if the ACTUAL value of a cell is 76.5, but it's showing 77

on
the worksheet, I want to make the value of that cell 77.

Or, if the value of a cell is 13.362145, but it's showing 13.36, I want to
make the value of that cell 13.36.

Only, I don't want to do this for the entire sheet, just the selected

range.
I'm thinking that if I create a custom function that says

For Each objC In Application.Selection.Cells

objC.Value = objC.DisplayedValue

Next

Only, I can't seem to find what that "displayed value" property is.

Any help would be great. Thanks.

--
Hmm...they have the Internet on COMPUTERS now!



  #4   Report Post  
Posted to microsoft.public.excel.programming
MDW MDW is offline
external usenet poster
 
Posts: 117
Default Get Displayed Value Of a Cell

Wow, I can't believe that one went over my head. I almost feel silly.

Thanks guys - works like a charm!

"Bob Phillips" wrote:

Range("A1").Text

is what you want as against .Value.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"MDW" wrote in message
...
I'm trying to write a function that does the same thing as the "precision

as
displayed" setting, but only for a certain range (the selected cells). Is
there any way to get at the displayed value of a cell? I think that will

help
me accomplish what I want.

For instance, if the ACTUAL value of a cell is 76.5, but it's showing 77

on
the worksheet, I want to make the value of that cell 77.

Or, if the value of a cell is 13.362145, but it's showing 13.36, I want to
make the value of that cell 13.36.

Only, I don't want to do this for the entire sheet, just the selected

range.
I'm thinking that if I create a custom function that says

For Each objC In Application.Selection.Cells

objC.Value = objC.DisplayedValue

Next

Only, I can't seem to find what that "displayed value" property is.

Any help would be great. Thanks.

--
Hmm...they have the Internet on COMPUTERS now!




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Get Displayed Value Of a Cell

You're welcome. Thanks for the feedback.


"MDW" wrote in message
...
Wow, I can't believe that one went over my head. I almost feel silly.

Thanks guys - works like a charm!

"Bob Phillips" wrote:

Range("A1").Text

is what you want as against .Value.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"MDW" wrote in message
...
I'm trying to write a function that does the same thing as the
"precision

as
displayed" setting, but only for a certain range (the selected cells).
Is
there any way to get at the displayed value of a cell? I think that
will

help
me accomplish what I want.

For instance, if the ACTUAL value of a cell is 76.5, but it's showing
77

on
the worksheet, I want to make the value of that cell 77.

Or, if the value of a cell is 13.362145, but it's showing 13.36, I want
to
make the value of that cell 13.36.

Only, I don't want to do this for the entire sheet, just the selected

range.
I'm thinking that if I create a custom function that says

For Each objC In Application.Selection.Cells

objC.Value = objC.DisplayedValue

Next

Only, I can't seem to find what that "displayed value" property is.

Any help would be great. Thanks.

--
Hmm...they have the Internet on COMPUTERS now!






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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displayed results in a cell WavMaster Excel Discussion (Misc queries) 3 February 7th 09 08:08 AM
Cell Displayed Does Not Equal Cell Copied myronbabcock Excel Worksheet Functions 1 January 29th 06 10:27 PM
Can multiple cell results be displayed in a single cell? FuadsCurse Excel Discussion (Misc queries) 2 May 18th 05 05:33 PM
Text wider than one cell is not displayed in the next empty cell Len Pace Excel Discussion (Misc queries) 5 February 18th 05 12:24 AM
displayed cell values tomoutdoors Excel Worksheet Functions 2 January 13th 05 09:34 PM


All times are GMT +1. The time now is 04:07 PM.

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

About Us

"It's about Microsoft Excel"