Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default difference between range.text and range.value

..text is read-only - .value is read-write

Cliff Edwards

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default 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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default 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.


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default 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

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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.

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default 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

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
sum the difference in a range carla Excel Worksheet Functions 2 November 21st 07 05:57 PM
Date Range & Difference pm_arrow Excel Worksheet Functions 2 October 29th 07 02:51 PM
Find the POSITION IN A RANGE of text in a string that matches value(s) in a range Cornell1992 Excel Programming 0 March 14th 06 07:19 PM
Range vs IRange What's the difference? Fredrik Wahlgren Excel Programming 4 February 15th 05 04:36 AM
Difference between range.formula and range.formulalocal Andy Excel Programming 3 May 1st 04 07:26 PM


All times are GMT +1. The time now is 12:35 AM.

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"