Scientific Notation problem

  • Thread starter Thread starter Sinner
  • Start date Start date
S

Sinner

Below code is wht i'm using to book a serial of 19 digits.

Start: 9904785190112345080
End: 9904785190112345089


The numbers though change due to scientific notation as numbers is
very long.
----------------------------------------------------------------------------------------------------
Sub UpdateQty()
If IsNumeric(txtStart.Text) And IsNumeric(txtEnd.Text) Then
'txtQty.Text = Format((CDbl(txtStart.Text) - CDbl(txtEnd.Text) -
1), String(Len(txtStart.Text), "0"))
txtQty.Text = (CDbl(txtEnd.Text) - CDbl(txtStart.Text) + 1)
End If
End Sub
 
Excel can only handle numbers up to 15 digits in length (more of a computer
issue than an XL issue but whatever). You have two choices.
1. format the cells as text so that when the number is entered it is text.
2. preceed the number with an apostophe ' to convert the number to text.
 
Back
Top