+ Reply to Thread
Results 1 to 8 of 8

Removing Line Gaps in Larger Tables

  1. #1
    Registered User
    Join Date
    05-03-2013
    Location
    Winnipeg
    MS-Off Ver
    Excel 2007
    Posts
    8

    Removing Line Gaps in Larger Tables

    Hi,

    I currently have a number of tables that are of the same width (4 columns) but have rows between them. I would like to have a formula that would take all the tables and remove the rows of empty lines between them. The attached file will explain better what I am looking to do. I am not familiar to VBA scripting so an array formula would be best for me.

    Thanks in advance for the help!
    Brock
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Removing Line Gaps in Larger Tables

    Using Column C since that column has data on every row we want to keep:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-03-2013
    Location
    Winnipeg
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Removing Line Gaps in Larger Tables

    I'm unfimiliar to VBA so I would prefer a formula to insert into cells G1, H1 and I1 and then autofill these down their respective columns. If you could rather give me suggestions for that method that'd be great!

  4. #4
    Registered User
    Join Date
    10-27-2012
    Location
    London
    MS-Off Ver
    Excel 2007-2010
    Posts
    59

    Re: Removing Line Gaps in Larger Tables

    Nice code JB, very crisp.

    brocko, in column E assuming your tables with 4 columns are columns A to D insert
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and drag the formula down.

    Stick an auto filter on, anything in column E with a zero is a line with blank cells in all column, delete visible cells once filtered by zero.

    This is essentially what JB has written in VBA.
    Break_Point

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Removing Line Gaps in Larger Tables

    VBA is pretty easy to use:

    How/Where to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save as a macro-enabled workbook

    The macro is installed and ready to use. Press Alt-F8 and select it from the macro list.


    =============

    A non-vba version of this same idea.

    1) Highlight column C
    2) Press Ctrl-G to open the GOTO window
    3) Click on the SPECIAL button
    4) Select Blanks and click OK (all blank cells are now highlighted)
    5) Press the keys Alt-E-D to open the DELETE window
    6) Select Entire Row and click OK

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Removing Line Gaps in Larger Tables

    The shaded areas indicate where I have done work with your worksheet.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  7. #7
    Registered User
    Join Date
    05-03-2013
    Location
    Winnipeg
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Removing Line Gaps in Larger Tables

    Hey guys thanks for all the help!!! I was looking for a self updating formula so this last post was what I was looking for. Again, huge thanks.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Removing Line Gaps in Larger Tables

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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