+ Reply to Thread
Results 1 to 11 of 11

Move cells adjacent to each other (delete blanks)

  1. #1
    Registered User
    Join Date
    02-14-2014
    Location
    Farmington, Utah
    MS-Off Ver
    Excel 2013
    Posts
    43

    Move cells adjacent to each other (delete blanks)

    I have a massive data file that has about 100k rows and I go out to column "KS". I have random blanks in between my data and I need to move all the data so it is adjacent to each other. The data on row "1" needs to stay on row "1" and if its on row "2" it needs to stay on row "2". I just need to delete the blanks between the cells. Thank you for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Move cells adjacent to each other (delete blanks)

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-14-2014
    Location
    Farmington, Utah
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Move cells adjacent to each other (delete blanks)

    Thank you for your help. Sorry I'm not sure is this a macro or vba and how do I get this to work exactly.

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Move cells adjacent to each other (delete blanks)

    You asked for VBA solution right? The entire code is just one line.

  5. #5
    Registered User
    Join Date
    02-14-2014
    Location
    Farmington, Utah
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Move cells adjacent to each other (delete blanks)

    No matter what I try I get a compile error: Invalid outside procedure

    Sorry I am a complete novice when it comes to coding

  6. #6
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Move cells adjacent to each other (delete blanks)

    The entire code is
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Move cells adjacent to each other (delete blanks)

    This is what JieJenn means (see attached)
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    02-14-2014
    Location
    Farmington, Utah
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Move cells adjacent to each other (delete blanks)

    Thank you! You are a lifesaver.

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Move cells adjacent to each other (delete blanks)

    @JieJenn
    Thank you! You are a lifesaver.

    @bbarth
    Glad you got it working.

    Good luck

  10. #10
    Registered User
    Join Date
    02-14-2014
    Location
    Farmington, Utah
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Move cells adjacent to each other (delete blanks)

    Sorry to bug you about this again. However, the code worked when I ran it on a small test group, but when I put it into my massive data set 100k rows columns to KS it just sits there. I thought it would take awhile because of the massive amounts of data so I set my computer to not go to sleep or hibernate or anything and left it over night thinking it would be done this morning. However, when I checked on it this morning it is still in the same predicament. Is it normal to take so long? Or did I do something wrong? Is it because I have data in columns "A-E" and then column "F" is where I need the data to start moving over? Any ideas? Thanks for your help.

  11. #11
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Move cells adjacent to each other (delete blanks)

    I had changed the code to UsedRange.
    Maybe change it to Cells as in JieJenn's code in post #6.

+ 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. Replies: 1
    Last Post: 11-09-2013, 06:11 AM
  2. [SOLVED] Counting blanks in non-adjacent cells
    By ClickingNoise in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-20-2013, 08:46 AM
  3. Copy cells to adjacent column, removing blanks
    By jbitluk in forum Excel General
    Replies: 8
    Last Post: 12-11-2009, 03:14 PM
  4. Move duplicate cells into adjacent columns
    By badgerade in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-11-2009, 07:59 AM
  5. Removing cells based on adjacent blanks
    By F6Hawk in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-28-2007, 08:17 AM

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