PC Review


Reply
Thread Tools Rate Thread

Convert String to Numeric Values

 
 
JenISCM
Guest
Posts: n/a
 
      9th Jan 2008
I have data string that I must convert to numeric values.

Ex:
00100200300400500600700800901000110015016

How do I get the above data string example to return the numeric values that
are three digit integers.

How do I get the number 16 for example?

Any assistance is appreciated

--
JenISCM
 
Reply With Quote
 
 
 
 
raskew via AccessMonster.com
Guest
Posts: n/a
 
      9th Jan 2008
Try this:

Public Sub MySplit(txtIn As String)
' copy/paste to a standard module
' input from debug window:
' call mysplit("00100200300400500600700800901000110015016")

Dim i As Integer
Dim n As Integer

i = 1
For n = 1 To CInt(Len(txtIn) / 3)
Debug.Print n & " - " & val(Mid(txtIn, i, 3))
i = i + 3
Next n
End Sub

Bob

JenISCM wrote:
>I have data string that I must convert to numeric values.
>
>Ex:
>00100200300400500600700800901000110015016
>
>How do I get the above data string example to return the numeric values that
>are three digit integers.
>
>How do I get the number 16 for example?
>
>Any assistance is appreciated
>


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200801/1

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      9th Jan 2008
On Wed, 9 Jan 2008 07:28:03 -0800, JenISCM <(E-Mail Removed)>
wrote:

>I have data string that I must convert to numeric values.
>
>Ex:
>00100200300400500600700800901000110015016
>
>How do I get the above data string example to return the numeric values that
>are three digit integers.
>
>How do I get the number 16 for example?
>
>Any assistance is appreciated


How long is a string? will it always be 48 characters long, or is it variable?

Val(Mid([string], 3*([Which number:] - 1), 3))

will prompt you for which substring you want and return the value in that
substring, if that helps you.

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert string value to numeric value alhotch Microsoft Access Queries 3 26th May 2010 01:47 PM
Convert string to Numeric in VB.net 2003 ? engteng Microsoft VB .NET 9 30th Sep 2008 10:24 PM
convert int to numeric (formatted) string raulavi Microsoft Dot NET 2 11th Mar 2008 02:42 PM
String results to convert to numeric values JenISCM Microsoft Access Getting Started 2 9th Jan 2008 07:52 PM
How to Convert Numeric Values into Text Values with a Formula Vijay Microsoft Excel Worksheet Functions 3 10th Nov 2003 03:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:17 AM.