Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Displaying cell contents
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Displaying cell contents
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" wrote in message ... |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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Displaying cell contents | Excel Discussion (Misc queries) | |||
Displaying contents of Active Cell | Excel Discussion (Misc queries) | |||
Displaying Cell Contents | Excel Discussion (Misc queries) | |||
Help with displaying the contents of the last populate cell. | New Users to Excel | |||
Displaying contents of cell on different spreadsheet | Excel Discussion (Misc queries) |