Results 1 to 2 of 2

Macro to delete empty rows based on row height.

Threaded View

  1. #1
    Registered User
    Join Date
    12-27-2013
    Location
    Oklahoma
    MS-Off Ver
    Excel 2010
    Posts
    33

    Macro to delete empty rows based on row height.

    I'm trying to create a macro to delete all empty rows but only if they are a certain row height. I currently have a macro that looks to the first cell and if it's empty, then it deletes the entire row. The only problem is that I would like to keep the shorter, empty rows to maintain my desired formatting. I will post the code I have if I can figure out how to do it properly and not violate the forum rules. Thank you in advance for any assistance you can provide.

    [code]
    Sub DeleteEmptyRows()

    'Cell A above and below each header contains white and gray text to maintain formatting when deleting empty rows'

    Dim i As Long, LastRow As Long
    LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row

    For i = LastRow To 1 Step -1
    If Cells(i, 1) = "" Then Rows(i).Delete
    Next



    End Sub

    [Code]
    Last edited by lans4rd; 02-13-2014 at 02:40 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to delete all empty rows
    By Learner1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2013, 11:40 PM
  2. Delete rows based on search with empty cells in between groupings
    By AggyRJ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2013, 12:09 AM
  3. is there a macro to delete empty rows?
    By Poseidons-Palace in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-23-2012, 03:12 AM
  4. Delete Rows Based On Multiple Cells Being Empty
    By Iwasiw35 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-14-2011, 05:46 PM
  5. Replies: 2
    Last Post: 08-24-2011, 05:42 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