Convert values to strings
One way:
With ActiveCell
.NumberFormat = "@"
.Value = Application.Round(.Value, 0)
End With
Since XL's parser interprets what VBA hands it as if the value were
typed, it doesn't do any good to use VBA's Format() method - the text
value will simply be interpreted as a number. Hence setting the number
format to Text first, so the value won't be parsed.
In article ,
"Chris" wrote:
I noramlly use the Text function to convert values. How do
I do it in VBA?
I tried ActiveCell.Value =
Application.WorksheetFunction.Text(ActiveCell.Valu e, "0")
but it didn't work.
Thanks in advance for any help.
|