+ Reply to Thread
Results 1 to 7 of 7

Search 'String' and tag accordingly using 'String table'

  1. #1
    Registered User
    Join Date
    04-11-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    10

    Search 'String' and tag accordingly using 'String table'

    Search 'String' and tag accordingly using 'String table'
    Hi everyone. First of all it’s a great forum and has been very helpful for my excel work. I am not that savvy with excel and got the following situation/s and any help/guidance would be highly appreciated.

    Back ground:
    I have to go through some cost items every month and sort them accordingly. I get the data dump (raw data tab on the attachment) and I need to tag them based on the description. I go through them by hand (about 400 line items) every month and very tedious and time consuming.

    Problem:
    Now I am looking for a way to automate them (as much as possible) by using a “string search’ table. My idea is that it will search the ‘description’ column and based on the ‘s-tabs’ table and once a string is found then it will retuen the data from first row of that column
    Attached Files Attached Files

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Sreach 'String' and tag accordingly using 'String table'

    Try this macro

    Please Login or Register  to view this content.
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007.
    Martin

  3. #3
    Registered User
    Join Date
    04-11-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Search 'String' and tag accordingly using 'String table'

    Hi martin,

    It works like a charm in the 2003 .xls but wheni copy it to .xlxs version them it give me 'run time error 9' any idea why?

    Thanks

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Search 'String' and tag accordingly using 'String table'

    If you hit debug, which line is highlighted in yellow?

  5. #5
    Registered User
    Join Date
    04-11-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Search 'String' and tag accordingly using 'String table'

    I took a screen shot of new file where the macro doesnt work and the highlighted area of the code.
    Attached Images Attached Images

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Search 'String' and tag accordingly using 'String table'

    In 2007, the workbook needs to be saved in .xlsm format.

  7. #7
    Registered User
    Join Date
    04-11-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Search 'String' and tag accordingly using 'String table'

    it works , there was a space after the tabs title which is why the macro wasnt working. Thanks mrice

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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