06-04-2012, 06:45 PM
Hi AAB,
We can do it using regular expression too. Checkout the below code
Let me known if you have any questions.
We can do it using regular expression too. Checkout the below code
Code:
input = "Page 22432 of 201222122"
Set objRegExp = New RegExp
objRegExp.Pattern = "[^A-Za-z ]\d*"
objRegExp.Global = True
Set Numbers = objRegExp.Execute(input)
msgbox Numbers.count
For I = 0 to Numbers.Count-1
If I = 0 Then
msgbox "Current Page Number: " & Numbers(I)
ElseIf I = Numbers.Count-1 Then
msgbox "Total Number of Pages:" & Numbers(I)
End If
Next
Set Numbers = Nothing
Set objRegExp = Nothing
Let me known if you have any questions.
Thanks,
SUpputuri
SUpputuri