Scientific Notation problem

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
 
G

Guest

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.
 

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

Top