ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   difference between range.text and range.value (https://www.excelbanter.com/excel-programming/421739-difference-between-range-text-range-value.html)

Sean Farrow

difference between range.text and range.value
 
Hi;
could somebody please explain the difference between rang.text and
range.value? When should I use both?
Chers
Sean.



ward376

difference between range.text and range.value
 
..text is read-only - .value is read-write

Cliff Edwards


Sean Farrow

difference between range.text and range.value
 
Chers, are there situations where I should use one and not the other?
Cheers
Sean.
"ward376" wrote in message
...
.text is read-only - .value is read-write

Cliff Edwards




Per Jessen

difference between range.text and range.value
 
I never use .Text, and I don't think anyone in this group ever use it.

..Value can be used for all purposes.

Regards,
Per

"Sean Farrow" skrev i meddelelsen
...
Chers, are there situations where I should use one and not the other?
Cheers
Sean.
"ward376" wrote in message
...
.text is read-only - .value is read-write

Cliff Edwards





ward376

difference between range.text and range.value
 
I haven't found any examples of different results when reading a cells
content with one or the other. The data types and characters returned
have been the same in my experience. Really, the only difference I've
ever found is that you can write with .value...

Cliff Edwards


Rick Rothstein

difference between range.text and range.value
 
See the help file example for the Text property of the Range object (put
text cursor on word Range, press F1, select Text from the Property drop
down).

--
Rick (MVP - Excel)


"Sean Farrow" wrote in message
...
Chers, are there situations where I should use one and not the other?
Cheers
Sean.
"ward376" wrote in message
...
.text is read-only - .value is read-write

Cliff Edwards





Jim Cone[_2_]

difference between range.text and range.value
 
Also...
..Text is what is displayed in the cell and
..Value is actually what is contained in the cell except when it isn't.
(.Formula and .Value2 are better choices sometimes)

An example: the cell.Value is 1.23456 but the cell.Text is 1.23 because
the cell is formatted as "0.00"
--
Jim Cone
Portland, Oregon USA



"Sean Farrow"
wrote in message
Hi;
could somebody please explain the difference between rang.text and
range.value? When should I use both?
Chers
Sean.



ward376

difference between range.text and range.value
 
Much better explanation Jim - I almost exclusively work with extracted
data and hadn't come across the formatting issue when reading cell
contents.

Thanks!
Cliff Edwards


Chip Pearson

difference between range.text and range.value
 
Range.Value returns the underlying value of a cell, regardless of how
that cell is formatted for output. Range.Text returns exactly what
appears in the cell. For example, if A1 contains the number 987.1234
and is formatted for 2 decimal places, A1.Value would return 987.1234
while A1.Text would return 987.12. The Text property is read-only, so
you cannot assign a value to it. It is the Value transformed by
NumberFormat to display in the cell.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Fri, 26 Dec 2008 20:55:54 -0000, "Sean Farrow"
wrote:

Hi;
could somebody please explain the difference between rang.text and
range.value? When should I use both?
Chers
Sean.


Dave Peterson

difference between range.text and range.value
 
Neither of those statements is true.

..Text has its own purpose and there are many in this newsgroup who use it
effectively.

Per Jessen wrote:

I never use .Text, and I don't think anyone in this group ever use it.

.Value can be used for all purposes.

Regards,
Per

"Sean Farrow" skrev i meddelelsen
...
Chers, are there situations where I should use one and not the other?
Cheers
Sean.
"ward376" wrote in message
...
.text is read-only - .value is read-write

Cliff Edwards




--

Dave Peterson

ward376

difference between range.text and range.value
 
I just found a difference (probably not a surprise to other
responders) but when reading cell values, range.text is limited to
1024 characters. Just had a cell with 6400+ characters (a distribution
list) and the len of range.text was 1024! Used range.value to get the
entire string into a variable.

Cliff Edwards



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

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