Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Mar 2006
    Location
    Philadelphia, PA
    Posts
    30
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Delete/Condense Rows

    Hi, I created a table using an ARRAY. The array is awesome because I pulled the data that I needed however, I have a number of blank cells. If the cells were truly "blank" I could select F5, Select Blank Cells and delete. I'm stumped b/c these cells truly aren't blank.

    Any suggestions on how to shift all relevant data together?

    File is attached.
    Attached Files Attached Files

  2. #2
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,832
    Thanks
    136
    Thanked 484 Times in 461 Posts
    Hi

    See attached file.
    Click button labelled [delete zero cells]

    zeddy
    Attached Files Attached Files

  3. The Following User Says Thank You to zeddy For This Useful Post:

    ab2537 (2013-03-16)

  4. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    Once again Zeddy was faster! Here's a slightly different approach you may find useful as it works on any selection vs having to change the programming for different ranges. HTH

    ab2537 ShiftCells.xlsm
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  5. The Following User Says Thank You to RetiredGeek For This Useful Post:

    ab2537 (2013-03-16)

  6. #4
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,832
    Thanks
    136
    Thanked 484 Times in 461 Posts
    Hi RG

    I knew I could provoke you into providing a better solution.
    Top marks!

    zeddy

  7. #5
    WS Lounge VIP
    Join Date
    Mar 2002
    Location
    Newcazzle, UK
    Posts
    2,832
    Thanks
    136
    Thanked 484 Times in 461 Posts
    ..however, what about preserving the cell formatting????
    (see attached file, with your code)

    I believe the best solution would be..
    1. read the selected range block into an array
    2. then process the array in vba
    3. then write the modified array back to the sheet as values

    I believe this would then presrve the original cell formatting.

    zeddy
    Attached Files Attached Files

  8. The Following User Says Thank You to zeddy For This Useful Post:

    ab2537 (2013-03-16)

  9. #6
    Lounger
    Join Date
    Mar 2006
    Location
    Philadelphia, PA
    Posts
    30
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Thanks to both of you; I will try both approaches :-)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •