+ Reply to Thread
Results 1 to 7 of 7

VBA Remove Noise Words from String

  1. #1
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    VBA Remove Noise Words from String

    I have this code that Sa Dq provided for me. I am now looking for a way to make this function refer to a range with a list of noise words and then remove those words from the title.
    For example:
    The following noise words would be in a list in cells A1:A4
    Ounces,
    Pound,
    Fl,
    oz,

    Then I would have another cell that contained the title for an item. Lets say this is cell C1
    "Big10 Apple Juice 12 ounces"
    I would then have the function RemoveNumbersFromString(C1,A1:A4) and the result would be
    "Big10 Apple Juice"

    Please Login or Register  to view this content.
    Does anyone know what I could do to make this code function the way I described above?
    Last edited by manofcheese; 06-09-2015 at 12:20 PM.

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA Remove Noise Words from String

    There might already be default functions to do this but I am not that good with the default functions. Here is a UDF as requested:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: VBA Remove Noise Words from String

    Thanks for the quick reply. I just tested it out but I can't get it to work. In a cell I put the function RemoveWordsFromString(A1,B1:B10). One of the noise words in the list was "ounce" and it didn't remove it from the title. Is there something I could do to change it to make the function work?

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA Remove Noise Words from String

    Hmm. It works for me. Submit your example workbook.

    Note: It is case sensitive so that might be causing you an issue
    Last edited by stnkynts; 06-09-2015 at 01:23 PM.

  5. #5
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    Re: VBA Remove Noise Words from String

    It looks like it worked. Is there a way to make it not case sensitive? Also, is it possible to have it take out the noise words only if it is a complete word. For example. Lets say "and" is one of the noise words I want to get rid of and "Band" is one of the words in the title. Currently the function just leaves "B" when i would like it to say "Band". Is there an adjustment that would work for this?

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: VBA Remove Noise Words from String

    Please Login or Register  to view this content.
    Last edited by stnkynts; 06-09-2015 at 05:22 PM.

  7. #7
    Registered User
    Join Date
    11-13-2006
    Posts
    87

    Re: VBA Remove Noise Words from String

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Remove/Keep words in string of Text
    By bfitzpa in forum Access Tables & Databases
    Replies: 1
    Last Post: 06-05-2014, 12:55 AM
  2. Replies: 5
    Last Post: 12-22-2011, 11:29 PM
  3. Remove word(s) from string beginning with words from this array
    By agf12555 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-22-2011, 12:28 PM
  4. need 2 formulas to remove words of varying length from a string
    By bikramksingh in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-26-2010, 01:49 AM
  5. Remove Certain Last Words from String
    By ShredDude in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-18-2008, 02:31 AM

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