Results 1 to 11 of 11

Clear contents of cells in a range, LEN=0

Threaded View

  1. #1
    Registered User
    Join Date
    05-27-2009
    Location
    Raleigh, North Carolina, USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Question Clear contents of cells in a range, LEN=0

    I'm using a macro to copy the results of a formula and paste the values only on another sheet. The result includes lots of "blank" rows. I have another macro to get rid of the empty rows and move the information up.

    It's not working because the "blank" rows aren't empty. Even though I paste values only, experimentation shows that the cells that appear blank return a false to the ISBLANK test with a length of 0.

    So now I think I need a macro to run after the pastespecial command to look for cells within a range with a length of zero and delete the contents of those cells, but leave alone anything with a length of >0.

    I am brand new to the idea of using VBA, but I have successfully cobbled together some stuff and can usually modify things to work.

    It seems I need to maybe use some sort of IF statement along with a LEN and ClearContents. I don't want to delete the blank cells, just make them truly empty so that all of my actual data stays where it should, and my delete empty rows macro works correctly.

    I did a search and see some info on clearing contents of columns or rows, or clearing contents based on the content of other columns or rows, but I'm unsure of how to tell it to search each cell within a range and clear the contents of 0-length cells to make them truly empty.

    Thanks muchly for your advice!

    Jenny
    Last edited by jenny_journalist; 12-28-2009 at 02:51 PM. Reason: changed title: solved

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