Results 1 to 4 of 4

Delete Blank rows between tables and keep one row.

Threaded View

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    egypt
    MS-Off Ver
    Excel 2013
    Posts
    33

    Delete Blank rows between tables and keep one row.

    hi,
    i've try to write a code remove any extra empty rows between the tables.

    there is actually more than two columns of tables ,but i give sample of two.

    the problem with the code is , it's very slow when the tables become little bigger.

    please any modification you can make on the code to make it faster will be appreciated.

    PHP Code: 

    Sub test
    ()
    Dim ssheet As String
    Dim rownum 
    As Integer
    Dim rng 
    As Range


    Application
    .ScreenUpdating False

    ssheet 
    "Summary"
    rownum 1


    For rownum 1 To 50
    If Application.WorksheetFunction.CountA(Worksheets(ssheet).Range("j" rownum ":n" rownum)) = 0 Then
        
        Range
    ("j" rownum ":n" rownum).Delete Shift:=xlUp
       

    End 
    If
    Next


    Application
    .ScreenUpdating True
    End Sub 


    if possible how can I modify the code to keep only one empty row between tables and keep the row between the table name and the table itself.


    please check the attached sample.

    highly appreciate you help.

    thanks in advance.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Delete blank/empty rows between two pivot tables
    By curious4 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2018, 01:45 PM
  2. [SOLVED] Delete blank rows between blocks of data except two blank rows
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-26-2018, 11:18 AM
  3. [SOLVED] VBA Find last row and column that contain data and delete all blank rows and blank columns
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-03-2012, 01:07 PM
  4. [SOLVED] How to Delete Multiple Consecutive Blank Rows - Delete all Blank Rows
    By raw_geek in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-16-2012, 03:17 PM
  5. [SOLVED] Delete blank rows after filter - if no blank rows exit sub
    By cmb80 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-27-2012, 10:00 AM
  6. Replies: 1
    Last Post: 05-10-2012, 04:58 PM
  7. [SOLVED] To delete blank rows having blank cell in the needed raws
    By Alexander_Golinsky in forum Excel General
    Replies: 4
    Last Post: 05-04-2012, 03:11 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