Entering a 30 digit number

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

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??
 
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.
 
ActiveCell.NumberFormat = "@"
activecell.Value = "123456789123456789123456789"

or

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top