The above code is input via a browser address, but I want to grab directly by VB numerical VAL=behind, need what to do, a great god, please help,
CodePudding user response:
Find VAL first, and then to find the back data is good, the function in vb Instr like?CodePudding user response:
Dim k As Long
Dim as Double d
K=InStr (S, "val=" "")
If k> 0 then d=CDbl (Mid (S, k + 5))
CodePudding user response:
And the difference is that on the second floor, don't need to count length, USES the characteristics of the string is "string can be separated by a space, to decompose the first array, and then specify which groups, then replace don't need to string", and, of course, such a common functionality I usually write function
Dim allstring As String 'pages you access this variable is used to store the String
Dim arr
Allstring=Text1. Text '" you get web page code function, it is assumed that is "in the Text box 1
Arr=Split (allstring, "") 'string section
Allstr=Replace (Replace (arr (2), "val=", ""), CRH (34)," ") characters' Replace don't need to empty
MsgBox allstr output
'