+ Reply to Thread
Results 1 to 3 of 3

Delete and shift remaining cells to the top.

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Delete and shift remaining cells to the top.

    I hate it when something simple becomes hard.

    See the attachment. All I want to do is delete all of the cells filled with only "d", and shift the remaining cells to the top. This is just a sample; my data set actually has about 250 columns of 12K rows each.

    I can do it fine manually, but only for a small subset. The larger the data set, the slower Excel operates, so I'd like to do it via VBA. The process I want to replicate in my macro is done like this: in my Usedrange, do a Find, "d", in "Values". Select all found. Delete. I thought I'd record the process to get the basic code for my macro. The below macro is what came out of the recording.
    Please Login or Register  to view this content.
    So I tried to do it on my won. The macro below is my attempt. For some reason, it only appears to work for one row at a time, and I don't know why. So, any help on this would be highly appreciated.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Delete and shift remaining cells to the top.

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Re: Delete and shift remaining cells to the top.

    Sixthsense,
    Thank you so much! Your macro worked great. I see that your macro deletes all of them at one shot, which mine didn't do. Maybe that's what makes the difference. I sure appreciate the help!

+ 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. [SOLVED] Delete all cells in each row except the last used cell then shift left all remaining data
    By dave033 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-16-2014, 09:33 AM
  2. Macro to Remove Cells = 0 and Shift Remaining Cells on Row Left w/ One Condition
    By Mark V. in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-07-2013, 12:45 PM
  3. [SOLVED] Find cells which contain specific word, delete cells and shift left.
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-24-2012, 07:00 AM
  4. Delete empty cells and shift remaining left
    By kiboodez in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2010, 02:17 PM
  5. Delete cells and shift up
    By smiso24 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-07-2009, 03:51 PM

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