+ Reply to Thread
Results 1 to 4 of 4

Delete Empty Cells With VBA

  1. #1
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Delete Empty Cells With VBA

    Hi All

    I need a vba that will delete all cells with value of "" or zero, not deleting the row or the column just deleting any contents, so that a hide row macro ( which i have set up) will not pick up these "" values & regard them as nonblank.

    Thanks
    Mark
    Last edited by markrennolds; 11-30-2010 at 12:26 PM.

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

    Re: Delete Empty Cells With VBA

    Hello friend,

    I am a little confused as to whether the cells contain the quotation marks or if they are blank and you used quotation marks to illustrate they are blank. In response to if the cell has a value of zero here is a loop which will work for you.

    Please Login or Register  to view this content.
    Note: You will want to adjust the range to meet your needs. Also, since i wasn't sure what the range was this may not be the best way to do what you want to do. For example if the range is really big this macro will be really slow. Let me know.

  3. #3
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: Delete Empty Cells With VBA

    Hi there

    Thanks for the code, i realised what i needed to do & adapted it to suit. I have included the code below to help anyone who might see it & need similar.

    Cheers
    Mark

    Please Login or Register  to view this content.

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

    Re: Delete Empty Cells With VBA

    Just wanted to update a better way for future readers now that I see what you want to do

    Try:
    Please Login or Register  to view this content.
    This way we only focus on column A rather than all the cells. Much faster

+ 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