I have a row in a cell, let's say it says "Client Ref: F123456PassPlus". Perhaps the line does not have a letter before the numbers, perhaps there is a character in the numbers, and perhaps there is a space between the letter and the numbers. I need to extract only numbers as a variable. I have code for this, but it does not know when to end the loop through the line. He must stop when there is something other than a number or symbol, but it continues.
IsNumber = 1 ref = "" If branch = "" Then e = b Else e = b + 1 End If f = 1 While IsNumber = 1 For intpos = 1 To 15 ref = Mid(x, e, f) f = f + 1 Select Case Asc(ref) Case 45 To 57 IsNumber = 1 Case Else IsNumber = 0 Exit For End Select Next IsNumber = 0 Wend
Any letters of variables that do not have definitions have been predefined, e indicates the code where to start copying, and x indicates the cell containing the string. At the moment, everything works fine, it starts with a number and copies them and builds them in a large and large line, but this will stop only when intpos reaches 15.
string vba excel-vba excel
Josh whitfield
source share