+ Reply to Thread
Results 1 to 7 of 7

Create a Macro from this simple search function

  1. #1
    Registered User
    Join Date
    08-24-2009
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Thumbs up Create a Macro from this simple search function

    HELP!!! I suck at this.
    I am using excel 2007 for database of a large e-commerce site.
    I am creating search-able attributes from keywords found in description, title and meta-data columns.

    I am using the following function in "column X" to search 4 columns (see formula) for specific music styles.
    Please Login or Register  to view this content.
    I have hundred of searches to do and this formula works but is extremely time consuming.


    It would be cool if I could search for multiple criteria simultaneously and have the columns created if a "true value" is returned.
    i.e Search columns A - C - D - F - H for all music style terms and output the "true - value" to separate columns. Which I will combine later.
    • Search for "Rock" (output to column X)
    • search for "jazz" (output "true" to column Y)
    • search for "Classical" (output "true" to column Z)
    • And So on

    Creating the columns via the macro is not essential, if I must first create the empty columns and make sure the macro outputs correctly, so be it.

    I don't know much about macros but from what I have read it seems like the way to go. I would then be able to use the maco's and create a template and use them for each csv file I receive from different publishing companies.

    Any suggestions would be extremely appreciated,
    McMasters

    sheet 1 contains relevant database info and the functions I am currently using.
    Sheet 2 contains a non ordered list of search criteria that I will be using in the macro.
    Attached Files Attached Files
    Last edited by McMasters; 08-24-2009 at 05:15 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    re: Create a Macro from this simple search function

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    08-24-2009
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    4

    re: Create a Macro from this simple search function

    Glad to be here,
    I have been searching for excel related terms all weekend. This forum seems to be very active.

    McMasters

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Create a Macro from this simple search function

    I have removed unnecessary wording from your Title, please read the ules as shg suggested
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    08-24-2009
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Create a Macro from this simple search function

    RULES
    "Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according"
    Sorry

    --- McMasters

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Create a Macro from this simple search function

    I would delete the 'spacer' columns, and then change the formula in (what is now) F2 to

    =IF(COUNTIF($A2:$E2, "* " & F$1 & " *"), F$1, "")

    ... and copy across and down. Then it's simple to add additional search terms in the top row and just drag the formulas across.

    I don't see that repeating the word in row 1 throughout the table adds much value. If you agree, you can change the formula to

    =IF(COUNTIF($A2:$E2, "* " & F$1 & " *"), "x", "")
    Last edited by shg; 08-24-2009 at 04:30 PM.

  7. #7
    Registered User
    Join Date
    08-24-2009
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    4

    Smile Re: Create a Macro from this simple search function

    Tried your suggestion and YOU ROCK!!!!!

    That is an awesome use of absolutes "$" -- I did not know that A$1 would follow the with copy. That is extremely important to know.

    I already have all the headers done so that simple change you made to use absolutes and using row 1 as the terms should do the trick.

    I believe this thread may be in the wrong category since this is more a function then a macro.

    Any how thanks a million.

    Cheers,
    ---McMasters

+ 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