+ Reply to Thread
Results 1 to 5 of 5

Macro to "clean" a column

  1. #1
    Registered User
    Join Date
    11-03-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Macro to "clean" a column

    Hi everyone,

    I need a little help to "clean" an excel file. I had started doing it manually but it takes too much time

    Here it is : I have this worksheet with 2 tabs, 1st tab is "filter", 2nd tab is "BDD".

    The list I wish to "clean" is in the column B of the "BDD" tab. I need to clean it according to 2 rules and have the result appear in column D.

    rule #1 : each cell end by "Gé : xxxx" or ": xxxx". I wish to take that off.
    example1 : "I went shopping today Gé : blop" -> "I went shopping today"

    rule #2 : somes cells contain word or expression I wish to remove as well. The list of the word to remove automatically is in the column A of the 1st tab "filter
    example2 : the word "car" appears in the "filter" column, then "this car is really expensive : a lot of money" -> "this is really expensive"

    /!\ the "filter" column can sometimes contain 2 words in a cell, if "car" and "blue car" are in the list, then "this blue car is really expansive" -> "this is really expansive"

    => And finally, to complicate things a little bit, each word to be removed can be potentially followed by the words "LP", "L.P." or "L.P". I need that removed too only when it follows directly the word in the "filter" column
    example3 : "the blue car LP is really expansive L.P : 100 bucks" -> "the is really expansive L.P"

    Thanks a lot if you can help me out on this

    ++
    Julie

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Macro to "clean" a column

    I suggest you post a sample workbook, showing representative data and desired results.

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to "clean" a column

    Please Login or Register  to view this content.
    Last edited by snb; 11-03-2010 at 07:47 AM.



  4. #4
    Registered User
    Join Date
    11-03-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Smile Re: Macro to "clean" a column

    Thanks a lot Snb, it works !!

    I just noticed a small problem concerning the "LP", "L.P" and "L.P." : they are sometimes removed correctly, sometimes not.

    Lets simplify the process : it is possible to have them removed systematically anywhere they appear ?

    Thanks a lot

    ++
    Julie

  5. #5
    Registered User
    Join Date
    11-03-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Macro to "clean" a column

    Anybody ?
    I just need the previous code modified so that all these "LP", "L.P." and "L.P" disappear.

    Thanks a lot if you can help me on this.

    ++
    Julie

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1