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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can i convert string to integer 1

Status
Not open for further replies.

H2

Programmer
May 17, 2001
24
0
0
HK
I have a string (eg. ABC123456CC), and wanna extract the number out (123456) and output it by adding 1 (123457)
how can i do it??

thanks
H2
 
Is the number always starting at position 4, length 6?

cTest = "ABC123456CC"
nResult = Cint(mid(cTest,4,6)) + 1 br
Gerard
 
no, it wont always be like this.
so any method to extract the number out?

thanks anyway :)
H2
 
Than i see no alternative then to parse your string and investigate each character with IsNumeric() . . . br
Gerard
 
thanks:)
it's very helpful for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top