+ Reply to Thread
Results 1 to 4 of 4

Macro to remove single-worded cells

  1. #1
    Registered User
    Join Date
    10-19-2012
    Location
    Egypt
    MS-Off Ver
    Excel 2003
    Posts
    40

    Macro to remove single-worded cells

    Hi,

    I have an Excel sheet where I need to delete cells within a specified column (say A), that contain a single word only (no spaces).
    I need a Macro that do the job with a click of a button.

    If doable, is there a chance to expand the number of words (or spaces) to apply the same rule on? (cells with 2 words, cells with 3 words...etc)

    I'd appreciate all responses

    Thank you

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to remove single-worded cells

    You don't necessarily need a macro. Just use a helper column alongside your data and count the number of spaces with a formula like

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This counts the number of spaces in A1.

    Copy this down then just filter on the helper column for whichever value you want, select all the filtered cells and hit delete.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: Macro to remove single-worded cells

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-19-2012
    Location
    Egypt
    MS-Off Ver
    Excel 2003
    Posts
    40

    Re: Macro to remove single-worded cells

    Quote Originally Posted by stnkynts View Post
    Please Login or Register  to view this content.
    This is even better than what I had in mind!!
    Thanks a lot Stnkynts

+ 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] How to subtract single cells with double digits into a single digit of a single cell.
    By greenfox74 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-11-2021, 02:05 AM
  2. Macro to Remove Cells = 0 and Shift Remaining Cells on Row Left w/ One Condition
    By Mark V. in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2013, 12:45 PM
  3. Need to remove leading single quote from text cells
    By katcar in forum Excel General
    Replies: 4
    Last Post: 10-09-2009, 04:48 PM
  4. Macro or Formula to remove Text from Cells
    By smck in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-10-2005, 11:06 PM
  5. VBA for plotting charts: Question re-worded
    By Diane in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2005, 10:06 AM

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