ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FormulaR1C1 - autoconverting strings to numerics (https://www.excelbanter.com/excel-programming/341464-formular1c1-autoconverting-strings-numerics.html)

Simon Woods[_4_]

FormulaR1C1 - autoconverting strings to numerics
 
I'm automating Excel from vb. I've a sheet object and I'm assigning

l_oSheet.Cells(Row,Col).FormulaR1C1 = CStr("03")

If I step it when I look at the contents of
l_oSheet.Cells(Row,Col).FormulaR1C1, It shows it is 3. I don't actually want
that but what I've assigned i.e. "03".

Do I have to set some other column property or assign to a different cell
property?

Thanks

Simon



ste

FormulaR1C1 - autoconverting strings to numerics
 
Hi Simon,

try this line before

l_oSheet.Cells(Row,Col).NumberFormat = "@"

Regards,
ste


Simon Woods[_4_]

FormulaR1C1 - autoconverting strings to numerics
 
Excellent thanks

"ste" wrote in message
ups.com...
Hi Simon,

try this line before

l_oSheet.Cells(Row,Col).NumberFormat = "@"

Regards,
ste





All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com