Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to convert strings to numbers or formulas
Message
From
04/04/2010 21:41:31
 
General information
Forum:
Microsoft Office
Category:
Excel
Miscellaneous
Thread ID:
01458675
Message ID:
01458678
Views:
35
>>Hello,
>>
>>How do you convert a string in an Excel cel to either a number to do artihmetic or a formula to evaluate.
>>
>>Examples:
>>String in cell: " 5.00" Want to convert to number 5.00
>>String in cell: "=SUBTOTAL(9,J4:J10)" Want to convert to formula =SUBTOTAL(9,J4:J10)
>>
>>I've tried Excel copy / paste special with no success.
>>
>>TIA,
>>
>>Alex
>
>Did you try setting NumberFormat for your first problem? And setting formula for the second?
>
>Re: Excel Automation Formatting and F9 Thread #1372023 Message #1372036

Thank you very much for the response Naomi.

I think your example inserts cells individually. I am trying to save time with a suggestion by Cetin that uses ADODB. The result is that the strings are copied to Excel and the issue becomes how to convert them to numbers or formulas using Excel.

NumberFormat does not work. The only way I found to convert to numbers is Copy / Paste Special with "Operation Add" to an empty worksheet and then copy back. Excel converts before adding.

That leaves formula conversion as a mystery.

Alex
Previous
Reply
Map
View

Click here to load this message in the networking platform