Consulting

Results 1 to 4 of 4

Thread: Solved: multiple Regular expressions on one cell to extract to new cells

  1. #1
    VBAX Newbie
    Joined
    Sep 2011
    Posts
    3
    Location

    Solved: multiple Regular expressions on one cell to extract to new cells

    I need to create a macro that will use my funtion to rxget to parse a colum and insert into a new column. I normally place this "=RXGET("^[0-9]{1,2}",D2)" inside the column and a different ""=RXGET" inside the next column and so on to pull the contents apart form one column D2. This is done manually, I would like to have a macro do this for me, instead of doing each column manually. I am not sure how to setup the macro to do this, so that is loops through the data column and pulls the data out and then goes to the next row and does it again until it finds an empty row.

    Thanks, Steve

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]
    Lastrow = Cells(Rows.Counr,"D").End(xlUp).Row
    Range("E2").Resize(Lastrow - 1).Formula = "=RXGET(""^[0-9]{1,2}"",D2)"
    'etc.
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Sep 2011
    Posts
    3
    Location
    Quote Originally Posted by xld
    [vba]
    Lastrow = Cells(Rows.Counr,"D").End(xlUp).Row
    Range("E2").Resize(Lastrow - 1).Formula = "=RXGET(""^[0-9]{1,2}"",D2)"
    'etc.
    [/vba]
    This looks good, can you give me a little more, I am new at macro, so I need some structure to get going, then I can add the additional formula's,
    thanks again.
    Steve

    Is there a good vba book you could also recomend.

  4. #4
    VBAX Newbie
    Joined
    Sep 2011
    Posts
    3
    Location
    Quote Originally Posted by lewgoofy
    This looks good, can you give me a little more, I am new at macro, so I need some structure to get going, then I can add the additional formula's,
    thanks again.
    Steve

    Is there a good vba book you could also recomend.
    I may need to add that I am trying to use the function RXGET.

    I guess I want to know how to call the function and use the formula inside the sub or do I put the function inside the sub, I can not find how to use a function within a macro.

    Thanks for any help.
    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •