+ Reply to Thread
Results 1 to 10 of 10

Deleting cells based on number of characters in a word

  1. #1
    Registered User
    Join Date
    03-07-2012
    Location
    Mexico City, MX
    MS-Off Ver
    Excel 2010
    Posts
    9

    Deleting cells based on number of characters in a word

    Hi, I have spreadsheets in which I need to remove any rows that contain words with less than three characters (letters or numbers) in one specific column. In other words, if the first column of my spreadsheet contains A1, or ft, or 45 as separate words. (random examples) that row would be removed.

    I'm not yet familiar with how to create and implement that type of find and replace function so I need specific and detailed instructions. Thanks so much.

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Deleting cells based on number of characters in a word

    One way would be using a macro like this:

    Please Login or Register  to view this content.
    This macro assumes that you checks the cells in column A. If it's column C you whish to chech change

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

  3. #3
    Registered User
    Join Date
    03-07-2012
    Location
    Mexico City, MX
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Deleting cells based on number of characters in a word

    Wow! thanks.

    I pasted the code into the visual basic macro page, selected my spreadsheet and ran the macro and...nothing happened. I wish I knew more about this but I don't write visual basic so I'm no help to myself. Any thoughts?

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Deleting cells based on number of characters in a word

    Hi

    How about attaching an example workbook. One other thing to check is that your cell actually only contains 2 character words, and not say, 2 chars with a third that is a space.

    rylo

  5. #5
    Registered User
    Join Date
    03-07-2012
    Location
    Mexico City, MX
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Deleting cells based on number of characters in a word

    Okay, now I see that I didn't explain that very well. The spreadsheets I'm editing have multi-word phrases in the A column. Any phrase that also contains a word or number combination with less than three characters will need to have it's row deleted. After the macro is run only those rows with phrases in column A that have no words or number combinations with less than three characters will remain. I've attached an example spreadsheet. Thanks so much. keywords1.xlsx
    Attached Files Attached Files
    Last edited by donaldc88; 03-07-2012 at 09:25 PM.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Deleting cells based on number of characters in a word

    Hi

    From what I can see in the example workbook, pretty much every row would be deleted. Is that right?
    Please Login or Register  to view this content.
    Maybe update your example workbook with a sheet to show what the result after action should be.

    rylo
    Last edited by rylo; 03-07-2012 at 09:41 PM.

  7. #7
    Registered User
    Join Date
    03-07-2012
    Location
    Mexico City, MX
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Deleting cells based on number of characters in a word

    No, the original worksheet has 4000 entries. I had to shorten it to meet the file size requirements for uploading to the forum. Most of the offending entries are at the beginning of the file. The concept will work for me. I just don't know how to do it. Thanks

  8. #8
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Deleting cells based on number of characters in a word

    Hi

    OK, I've edited my post with some code. See how that goes.

    rylo

  9. #9
    Registered User
    Join Date
    03-07-2012
    Location
    Mexico City, MX
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Deleting cells based on number of characters in a word

    No, the original worksheet has 4000 entries. I had to shorten it to meet the file size requirements for uploading to the forum. The concept will work for me. I just don't know how to do it. Thanks

  10. #10
    Registered User
    Join Date
    03-07-2012
    Location
    Mexico City, MX
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Deleting cells based on number of characters in a word

    Awesome, that worked perfectly. I sure do appreciate you taking the time to pop that out for me. Perfect.

+ 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