+ Reply to Thread
Results 1 to 6 of 6

VBA Code to optimize and clean data- clean out numerical/ or symbol

  1. #1
    Registered User
    Join Date
    04-05-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2007
    Posts
    4

    VBA Code to optimize and clean data- clean out numerical/ or symbol

    Hi All,
    I got a question:

    If i am have a data needed to be clean, and the cell is really mess up with random number and other symbol.

    For example, same data of store name are like
    apple 123
    apple #123
    123# appl
    no. 123appl NY
    7-11 1234
    1451 7-11
    first 4 need to be changed into apple
    and while the last 2 need to be 7-11 or seveneleven
    need to change million cells. And there are over thousands of store name.

    Any suggestions?
    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    03-14-2012
    Location
    Arizona USA
    MS-Off Ver
    Excel 2000/2007
    Posts
    408

    Re: VBA Code to optimize and clean data- clean out numerical/ or symbol

    There is NO simple way to do this.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA Code to optimize and clean data- clean out numerical/ or symbol

    Hello tracylsr ,

    Welcome to the Forum!

    This can be cleaned rather easily using Regular Expressions. Is "appl" correct or a typo?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    04-05-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA Code to optimize and clean data- clean out numerical/ or symbol

    Thanks Leith~

    Its a typo, but it is in the data set, need to be changed into "apple".
    -----
    There will be over ten thousands of store names, with over thousands of different branch name, is it still work for regular expression?
    Eg:
    Macy's
    Apple,
    .....

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: VBA Code to optimize and clean data- clean out numerical/ or symbol

    Hello,

    I'm not quite sure if this is easier or not but I have attached a spreadsheet that accomplishes what you are trying to do. In the code I have indicated how you would add the additional criteria.

    Let me know if it works.

    Thanks!

  6. #6
    Registered User
    Join Date
    04-05-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA Code to optimize and clean data- clean out numerical/ or symbol

    Thanks rvasquez!
    That works!
    Really appreciate!

+ 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