+ Reply to Thread
Results 1 to 9 of 9

Replace Empty Text/Space in all Empty Cells

  1. #1
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Replace Empty Text/Space in all Empty Cells

    Hi Experts,

    How can i remove/replace all empty text/space in all the cell in a sheet? There's no visible data on the cell but when i use =COUNTA to check - it results into a number which proves that there are empty spaces/text in the cell.

    Need the macro to only remove empty text/space on empty cells and not spaces on real values. I can use REPLACE but it also removes spaces from cells with true values.

    Please help.
    If I've helped U pls click on d *Add Reputation

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Replace Empty Text/Space in all Empty Cells

    I loaded K14 with spaces and this cleared them:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Re: Replace Empty Text/Space in all Empty Cells

    Thank you xladept. It's not working though.

    I'm copying cells from one sheet to another. The source formula in Sheet 1 Row 1 goes like this A1=IF(A2="","",A2) then i hit submit and it's copied to Sheet2.

    Now if A2 is blank from sheet1 is blank - when its copied to sheet2 - the cell its copied to is visibly blank but when i use =COUNTA() to confirm it says 1.

    THe only way to remove the unseen/empty text is go the cell and press DEL.

    How can i override this? Is there a more efficient formula that will not copy empty cells from the source sheet?

    Please help.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,040

    Re: Replace Empty Text/Space in all Empty Cells

    Do a COUNTA minus a COUNTBLANK.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Re: Replace Empty Text/Space in all Empty Cells

    Thank you AligW. but I'm just using =COUNTA to check.. the problem is when i view the copied data from Sheet 1 to Sheet 2 the cells are not really "empty".

    It's copied to cells are visibly empty but there's a value in it that can only be removed by going to the cell and pressing DEL.

    Need help.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,040

    Re: Replace Empty Text/Space in all Empty Cells

    I'm advising you to do this:

    =COUNTA(range)-COUNTBLANK(range)

    EDIT: Sorry - just realised you want a macro.

  7. #7
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    633

    Re: Replace Empty Text/Space in all Empty Cells

    Hi AligW

    Not sure how i could incorporate that into the code.

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Replace Empty Text/Space in all Empty Cells

    Maybe:

    Please Login or Register  to view this content.
    Or, for a more complete cleanup:

    Please Login or Register  to view this content.
    Last edited by xladept; 07-04-2018 at 01:25 PM.

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

    Re: Replace Empty Text/Space in all Empty Cells

    bhenlee
    See if this works.
    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. How to find last cells in a column (ignoring empty space in a cell)?
    By niuyuer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2016, 03:36 PM
  2. Replies: 6
    Last Post: 03-14-2015, 08:23 AM
  3. [SOLVED] How to remove empty space, unable to make pvot, because pvot calculate empty space
    By vengatvj in forum Excel Charting & Pivots
    Replies: 20
    Last Post: 10-29-2013, 12:43 PM
  4. Excel 2007 : Howto delete an empty space in cells
    By Doggen in forum Excel General
    Replies: 1
    Last Post: 02-02-2011, 04:48 AM
  5. put Text box value into 1st empty space in colum
    By D_Rennie in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-04-2009, 07:57 AM
  6. Replace empty cells with blank space
    By charles.2345 in forum Excel General
    Replies: 10
    Last Post: 08-02-2008, 08:31 PM
  7. Empty cells taking up space
    By johncassell in forum Excel General
    Replies: 2
    Last Post: 01-31-2008, 10:10 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