Jul 15, 2001 #1 H2 Programmer Joined May 17, 2001 Messages 24 Location 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
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
Jul 15, 2001 1 #2 foxbox Programmer Joined Sep 11, 2000 Messages 1,052 Location NL Is the number always starting at position 4, length 6? cTest = "ABC123456CC" nResult = Cint(mid(cTest,4,6)) + 1 br Gerard Upvote 0 Downvote
Is the number always starting at position 4, length 6? cTest = "ABC123456CC" nResult = Cint(mid(cTest,4,6)) + 1 br Gerard
Jul 15, 2001 Thread starter #3 H2 Programmer Joined May 17, 2001 Messages 24 Location HK no, it wont always be like this. so any method to extract the number out? thanks anyway H2 Upvote 0 Downvote
Jul 16, 2001 #4 foxbox Programmer Joined Sep 11, 2000 Messages 1,052 Location NL Than i see no alternative then to parse your string and investigate each character with IsNumeric() . . . br Gerard Upvote 0 Downvote
Than i see no alternative then to parse your string and investigate each character with IsNumeric() . . . br Gerard
Jul 16, 2001 Thread starter #5 H2 Programmer Joined May 17, 2001 Messages 24 Location HK thanks it's very helpful for me. Upvote 0 Downvote