Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ways to perform extraction
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi AAB,

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
Reply


Messages In This Thread
Ways to perform extraction - by AAB - 06-01-2012, 04:34 PM
RE: Ways to perform extraction - by AAB - 06-04-2012, 12:22 PM
RE: Ways to perform extraction - by supputuri - 06-04-2012, 06:45 PM
RE: Ways to perform extraction - by AAB - 06-05-2012, 12:36 PM
RE: Ways to perform extraction - by supputuri - 06-05-2012, 09:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Alternate ways to input data Silpa 7 5,385 03-09-2012, 09:28 AM
Last Post: Silpa
  Perform Action on Browser using only VBScript bfakruddin 2 2,753 09-08-2010, 06:57 PM
Last Post: cdesserich
  How to perform the Filter action in excel using vb script? venkatbatchu 6 31,622 10-08-2009, 03:05 PM
Last Post: venkatbatchu
  How many ways we can use external XL sheet data import in to runtime datatable govqa 1 3,465 02-18-2009, 11:09 PM
Last Post: sreekanth chilam

Forum Jump:


Users browsing this thread: 2 Guest(s)