sam314159
05-20-2010, 05:20 AM
I have the following VBA code in a macro:
Dim someValue As String
someValue = "4"
Range(A1).Select
ActiveCell.FormulaR1C1 = someValue
I want to enter that someValue, 4, into the cell as PURE text. I don't want Excel to give me that stupid "Number stored as text error". That messes me up because the spreadsheet has to later be processed by label printing software and the software needs pure text only.
I have tried
someValue = CStr(4)
And it didn't work. The only thing that worked so far, is something cheesy like:
someValue = "Number 4".
Is there any way to make someValue = 4 and still store it as a pure string?
PS The cell is already formatted as a 'Text'.
Dim someValue As String
someValue = "4"
Range(A1).Select
ActiveCell.FormulaR1C1 = someValue
I want to enter that someValue, 4, into the cell as PURE text. I don't want Excel to give me that stupid "Number stored as text error". That messes me up because the spreadsheet has to later be processed by label printing software and the software needs pure text only.
I have tried
someValue = CStr(4)
And it didn't work. The only thing that worked so far, is something cheesy like:
someValue = "Number 4".
Is there any way to make someValue = 4 and still store it as a pure string?
PS The cell is already formatted as a 'Text'.