Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Entering a 30 digit number

I want to insert a 30 digit number in a cell. When i
insert the number excel rounds it off. Is there any way i
can display the 30 digit number without it being rounded
off?
For Eg. if i enter 123456789123456789123456789 in a cell
Excel rounds it off to 1.23456789123456E+26.

Which property will I have to set if i am using an excel
object in my VB code??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default Entering a 30 digit number

You need to either format the cell as text, or prefix it with an apostrophe, as Excel will only
recognise 15 significant digits on a number. Converting it to text will increase that to the
relevant string limits.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL2K & XLXP

----------------------------------------------------------------------------
Attitude - A little thing that makes a BIG difference
----------------------------------------------------------------------------



"Jay" wrote in message ...
I want to insert a 30 digit number in a cell. When i
insert the number excel rounds it off. Is there any way i
can display the 30 digit number without it being rounded
off?
For Eg. if i enter 123456789123456789123456789 in a cell
Excel rounds it off to 1.23456789123456E+26.

Which property will I have to set if i am using an excel
object in my VB code??



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Entering a 30 digit number

ActiveCell.NumberFormat = "@"
activecell.Value = "123456789123456789123456789"

or

ActiveCell.NumberFormat = "@"
varr = cdec("123456789123456789123456789")
activecell.Value = cStr(varr)



--
Regards,
Tom Ogilvy


Jay wrote in message
...
I want to insert a 30 digit number in a cell. When i
insert the number excel rounds it off. Is there any way i
can display the 30 digit number without it being rounded
off?
For Eg. if i enter 123456789123456789123456789 in a cell
Excel rounds it off to 1.23456789123456E+26.

Which property will I have to set if i am using an excel
object in my VB code??



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
entering 16 digit numbers - last digit turns to zero dreamer New Users to Excel 4 May 9th 09 01:04 AM
Entering a 16 digit number Tbird Excel Discussion (Misc queries) 1 August 11th 05 03:11 AM
entering 16 digit number in Excel suffix 0 comes automatically Ravi Mohan Sahay Excel Discussion (Misc queries) 2 June 18th 05 08:45 PM
entering a number of more than 1 digit lsu-i-like Excel Discussion (Misc queries) 4 June 15th 05 11:51 PM
entering a 16 digit number - last value changes to 0 SNAP Excel Discussion (Misc queries) 2 May 23rd 05 02:32 PM


All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"