Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trimming off numbers

Status
Not open for further replies.
May 7, 2004
17
US
I need some help. I am a novice at this.

I have a set of numbers, like below, but all I need is the first five numbers and I dont know how to pull out just those numbers
24860026
24845029
24816028
16944022
16943025
16941021
17896025

I would great love the help.
Thanks in advance.
 
strFull = CString(24860026)
strFirstFive = Left(strFull, 5)
nFirstFive = CInt(strFirstFive)

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
If you convert the numbers to a string you can use the left function.

Code:
Debug.Print Left(Trim(Str(24860026)), 5)

Remember to convert them back to numbers.

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top