 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
LukaM Guest
|
Posted: Wed Apr 25, 2007 2:24 pm Post subject: Convert to number in excel from delphi |
|
|
I'm transfering data from delphi with sql into excel worksheet, and numbers
in cells are beeing stored as text (I can correct them in Excel with
Tools>Error checking, or to select cell range and clicking on the yellow
exclamation sign and then Convert to number).
I need to select cell range and convert it to number from Delphi. |
|
| Back to top |
|
 |
Krisztian Pinter Guest
|
Posted: Wed Apr 25, 2007 4:24 pm Post subject: Re: Convert to number in excel from delphi |
|
|
On Wed, 25 Apr 2007 11:24:02 +0200, LukaM <luka.matijevic (AT) presoflex (DOT) hr>
wrote:
| Quote: | I'm transfering data from delphi with sql into excel worksheet, and
numbers
in cells are beeing stored as text (I can correct them in Excel with
Tools>Error checking, or to select cell range and clicking on the yellow
exclamation sign and then Convert to number).
I need to select cell range and convert it to number from Delphi.
|
i don't know what method you are using, but i recommend the following
1. create a variant array with VarArrayCreate, type varVariant
2. populate with data, using correct types
3. put the whole array at once into excel with Range[].Data := YourArray;
this is the fastest and more reliable way. |
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Wed Apr 25, 2007 5:32 pm Post subject: Re: Convert to number in excel from delphi |
|
|
| Quote: | I'm transfering data from delphi with sql into excel worksheet, and
numbers in cells are beeing stored as text (I can correct them in Excel
with Tools>Error checking, or to select cell range and clicking on the
yellow exclamation sign and then Convert to number).
|
Use the .value2 property rather than .value
Oliver Townshend |
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Thu Apr 26, 2007 12:46 am Post subject: Re: Convert to number in excel from delphi |
|
|
Use the NumberFormat property for range (applied to cell, column etc)
yourCellRange.NumberFormat := '0.00'
--
With best regards, Mike Shkolnik
Scalabium Software
http://www.scalabium.com
mshkolnik (AT) scalabium (DOT) com
"LukaM" <luka.matijevic (AT) presoflex (DOT) hr> wrote in message
news:462f1e0b (AT) newsgroups (DOT) borland.com...
| Quote: | I'm transfering data from delphi with sql into excel worksheet, and
numbers
in cells are beeing stored as text (I can correct them in Excel with
Tools>Error checking, or to select cell range and clicking on the yellow
exclamation sign and then Convert to number).
I need to select cell range and convert it to number from Delphi.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|