MrExcel Publishing
Your One Stop for Excel Tips & Solutions

16 digit numbers


Posted by Bob Camacho on June 20, 2001 11:03 AM

Can someone tell me how to get Excel to accept a 16 digit or larger number into a single cell? After 15 digits, Excel replaces all digits with 0.
Example:
1111111111111111 reads 1111111111111110
999999999999999999 reads 999999999999999000


Posted by mseyf on June 20, 2001 11:40 AM

you can try to either format the cell as text (Format>Cell>Number) or start the number with an apostrophe.

Posted by Bob on June 20, 2001 2:06 PM


Posted by Mark W. on June 20, 2001 3:28 PM

> ...but I cannot use the number as a number.

Yes, you can... =REPT("1",16)+20000000000 equals
1.11113+E15. The arthimetic operator coerces the
text value into a numeric.

Posted by Jerid on June 21, 2001 11:38 AM

I Had the same problem, this is what I did.

Change to fit your needs.

Just format the cell as Text, click the cell and run this Macro.

Sub AddOne()
Dim vTemp1 As Variant
Dim vTemp2 As Variant

vTemp1 = CDec(ActiveCell.Value
vTemp2 = vTemp1 + 1
ActiveCell.NumberFormat = "@"
ActiveCell.Value = CStr(vTemp2)
End Sub

I hope this helps

Jerid