+ Reply to Thread
Results 1 to 5 of 5

designing a macro to find keywords and make an entry into adjacent cell

  1. #1
    Registered User
    Join Date
    03-26-2010
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Smile designing a macro to find keywords and make an entry into adjacent cell

    Hi there,
    Can anyone help me write a macro?
    I’m trying to write a macro that will find certain keywords in column A and when these are found make an entry in the adjacent cell in column B.
    I am trying to organise a spreadsheet of organisations by their activity types based on text in their names. So, for example, many entries in column A will contain the word “church” and for these I would like the macro to enter the word “religious” in the adjacent cell in column B.
    If possible I’d like the macro to be able to do this with many keywords.
    Any help would be much appreciated, thanks in advance.

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

    Re: designing a macro to find keywords and make an entry into adjacent cell

    It sounds fairly straightforward, but would help if you attached a workbook with a sample of data and your rules concerning keywords.

  3. #3
    Registered User
    Join Date
    03-26-2010
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: designing a macro to find keywords and make an entry into adjacent cell

    ok so heres a sample of the data,
    I'm trying to match as much as possible to the activity types below:

    Animals
    Arts & Culture
    Children and Youth
    Development, Housing & Employment
    Disability
    Education & Training
    Elderly
    Environment
    General Charitable Purposes
    Health
    Heritage
    International Development
    Mental Health
    Political Party
    Religious Activities
    Rights, Law & Conflict
    Sport & Recreation
    Welfare

    ideas for kewords are: child, environ, hospice, hospital, etc.
    Attached Files Attached Files

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

    Re: designing a macro to find keywords and make an entry into adjacent cell

    This should start you off, but you need to come up with a precise list of keywords and categories, and also think about overlap between them, e.g. is "church school" religious or education or both?
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-26-2010
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: designing a macro to find keywords and make an entry into adjacent cell

    hey thanks a lot for the help. sorry to test your patience, i'm a proper noob on excel, expecially with macros.
    can't work out where in the code the keywords and category words would go, but thats just me being so inexperienced.
    would it be possible to just add on extra copied lengths of the same code but with different keywords and categories inserted?
    also, don't know what to do about overlap. Would the categories end up being listed if there was overlap? - if so that'd suit me just fine.
    so the categories are in my last post. ok, to do one category properly, let's say we're doing Arts & Culture: the keywords I'd be after to make that category entry would be: art, museum, paint, gallery, choir, orchestra, opera, concert, music, library, ballet.
    might not seem to useful with the kind of small sample i've given, but there's tens of thousands to go through.
    btw, all this is in aid of research to help charities, so its for a good cause!
    thanks again

+ 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