+ Reply to Thread
Results 1 to 4 of 4

Removing Blank Cells in an Array and Condensing

  1. #1
    Forum Contributor
    Join Date
    10-01-2007
    Posts
    101

    Removing Blank Cells in an Array and Condensing

    Im looking for help in removing blank cells from an array and condensing the array so that all non-zero values are listed in touching cells.

    ex:

    (blank) value1 (blank) value2

    to

    value1 value2


    thanks.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    When you delete a cell you have to decide whether to shift the cells below it upward or shift the cells to the right over to the left.

    Do you always have a preference as to which you want? Shifting cells up would maintain columns individually, while shifting cells left would keep rows intact.

  3. #3
    Forum Contributor
    Join Date
    10-01-2007
    Posts
    101
    yes, im sorry---

    the previous example was a rows example. I want blanks eliminated and any filled cells shifted to the left.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    This code should do what you're looking for. You can either adjust the range as needed (if it's always the same range of cells) or add a few lines to determine either the active selection or the "UsedRange".
    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)

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