PC Review


Reply
Thread Tools Rate Thread

Displaying cell contents

 
 
Gustaf
Guest
Posts: n/a
 
      14th Apr 2008
I wonder if it's possible when adding data to cells using VBA, to have one actual value (as seen in the Formula Bar) and another value that is displayed in the cell? I tried the Range.Value and Range.Text properties, but Range.Text won't work.

Range("D2").Value = "value"
Range("D2").Text = "text"

Row 2 gives error 424, object required. What kind of object does Text want?

Gustaf
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      14th Apr 2008
I think it wants the kind of object that can have its Text property changed.
For a range the Text property is read only.

You cannot have a different value in the cell than appears in the formula
bar, other than for number formatting. For example you could enter 1.234 in
a cell and number format it to show only 2 decimal places -> 1.23.

Taken to an extreme you could give the cell a custom number format like
"2222" which is what would always appear in the cell if any number is
entered.

You could also cover the cell with a text box and enter a different number
in it.

--
Jim
"Gustaf" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
|I wonder if it's possible when adding data to cells using VBA, to have one
actual value (as seen in the Formula Bar) and another value that is
displayed in the cell? I tried the Range.Value and Range.Text properties,
but Range.Text won't work.
|
| Range("D2").Value = "value"
| Range("D2").Text = "text"
|
| Row 2 gives error 424, object required. What kind of object does Text
want?
|
| Gustaf


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying cell contents BlueAngel Microsoft Excel Misc 3 6th Mar 2010 01:12 AM
Displaying Cell Contents ajones1978 Microsoft Excel Misc 3 10th Sep 2008 10:35 PM
Displaying contents of cell on different spreadsheet telewats Microsoft Excel Misc 1 26th Jan 2006 04:58 PM
Cell Contents, displaying * atomic_pope Microsoft Excel Discussion 1 26th Nov 2004 03:54 PM
delay in displaying cell contents Dave Microsoft Excel Misc 1 16th Oct 2004 06:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:19 AM.