+ Reply to Thread
Results 1 to 11 of 11

VBA macro for stop words in seperate sheet

  1. #1
    Registered User
    Join Date
    01-06-2016
    Location
    Dreamland
    MS-Off Ver
    Win 10
    Posts
    5

    VBA macro for stop words in seperate sheet

    I found this excellent post how to create a macro to clean text of stop words. http://www.excelforum.com/excel-gene...-in-excel.html and found how add more stop words by referencing to another excel sheet. When I run the code I don't get an error message but the stop words are still in the file. I am a bit lost here because it doesn't give me an error message. I checked that the cells are formated as text, but still no solution.
    I am using Excel 2013. I cannot attach the file because it is to big with 1.12MB and I deleted the majority of the cells. This is the macro code I am using:
    Please Login or Register  to view this content.

    Many thanks!
    Simone
    Last edited by alansidman; 01-06-2016 at 07:47 PM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2509 Win 11
    Posts
    24,994

    Re: VBA macro for stop words in seperate sheet

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2505
    Posts
    2,792

    Re: VBA macro for stop words in seperate sheet

    I cannot attach the file because it is to big with 1.12MB and I deleted the majority of the cells.
    You can zip the file and upload it.

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: VBA macro for stop words in seperate sheet

    Simone_,

    Thanks for the Private Message, and, confidence.

    I am using Excel 2013. I cannot attach the file because it is to big with 1.12MB
    It was suggested that you ZIP the workbook. I have had bad experience in the past, and, will not accept/open a zipped file.

    I can not find my old instructions that will explain how to attach a smaller file.

    But, you can post your workbook/worksheets to the following free site (sensitive data changed), and provide us with a link to your workbook:

    https://dropbox.com
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2509 Win 11
    Posts
    24,994

    Re: VBA macro for stop words in seperate sheet

    Simone:

    Attach a sample workbook. It does not need to be the entire file. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  6. #6
    Registered User
    Join Date
    01-06-2016
    Location
    Dreamland
    MS-Off Ver
    Win 10
    Posts
    5

    Re: VBA macro for stop words in seperate sheet

    Thanks AlanSidman and Skywriter for the suggestions re file size.
    I already downsized my Excel sheet with the results by more than half, but the file size didn't go down much. After the second error message from the up-load centre I decided to not pursue the file size issue. In hindsight I could have cut down my vlookup table. And ZIPing is certainly a good idea too! But my first and foremost problem is the macro and not the file size. I guess that is why I focused on the macro question instead of reducing the file size.
    Thanks for the information re code posting. Duly noted.
    Last edited by Simone_; 01-08-2016 at 07:29 AM.

  7. #7
    Registered User
    Join Date
    01-06-2016
    Location
    Dreamland
    MS-Off Ver
    Win 10
    Posts
    5

    Re: VBA macro for stop words in seperate sheet

    Enclosed the file :-)
    I would need to use about 200 stop words and the raw data will be approx 48 rows x 50 columns in case that matters.
    Many thanks,
    Simone
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: VBA macro for stop words in seperate sheet

    Not really sure though...
    Do you just want to clear the cells which match to the stopword?
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-06-2016
    Location
    Dreamland
    MS-Off Ver
    Win 10
    Posts
    5

    Re: VBA macro for stop words in seperate sheet

    Hi Jindon
    Yes that is exactly what I like to do. Quickly tried your code and it worked in both the test and the real data file. Though one thing I noticed is that it doesn't make a difference between 'as' and 'was'. Instead of replacing 'as' with nothing it replaces 'was' with nothing, i.e. leaving 'w..' Is there a way I can tell the macro to only replace exact word matches? I.e. a "false statement"?

    Thank you very much! / "Arigato goza-maas"
    Simone

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: VBA macro for stop words in seperate sheet

    Quote Originally Posted by Simone_ View Post
    Though one thing I noticed is that it doesn't make a difference between 'as' and 'was'. Instead of replacing 'as' with nothing it replaces
    It is impossible to me.

    It only clears the cell(s) with exact match, so it should not replace "was", unless you have "was" in the stopword list...

  11. #11
    Registered User
    Join Date
    01-06-2016
    Location
    Dreamland
    MS-Off Ver
    Win 10
    Posts
    5

    Re: VBA macro for stop words in seperate sheet

    Thanks for clarifying Jindon. I will have another try in a new Excel file to make sure that there is no other code somewhere influencing this macro.

+ 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. [SOLVED] Macro to remove 650 stop words from excel text
    By PiaHarrison in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-18-2016, 03:56 PM
  2. Replies: 1
    Last Post: 12-01-2011, 09:14 AM
  3. To seperate two numbers or words which has symbol between them
    By Meitreya in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-08-2010, 02:04 AM
  4. I want to seperate the words
    By ianternet in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-04-2008, 07:54 PM
  5. seperate words in a cell
    By JR in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-06-2006, 05:40 PM
  6. [SOLVED] RE: seperate words in a cell
    By JR in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-06-2006, 05:35 PM
  7. [SOLVED] Seperate two words in a cell
    By Gary in forum Excel General
    Replies: 2
    Last Post: 07-20-2005, 11:05 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