Results 1 to 4 of 4

Macro to delete entire row (within a specified range) if cell in column A is empty

Threaded View

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question Macro to delete entire row (within a specified range) if cell in column A is empty

    Hello,

    I'm fairly new to Excel macros and am not a programmer, but I'm trying to create a macro that will delete rows in a spreadsheet if the cell in column A of that row is empty. I made a macro that does this, but the problem I'm having is that I only want it to run on a specified range of cells. For example, I only want the macro to affect rows 7 to row 38 in the example below. When I run the macro, it runs on all rows. The first few rows in my spreadsheet have blank cells in column A (but have data in the other columns), but I need to retain these rows.

    Sub DeleteRowifCellAisBlank()
        ActiveSheet.Range("A7:F38").Select
        Columns(1).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    End Sub
    How can I edit this so that it only runs on a specified range? I have about 15 different 30,000+ row spreadsheets, all with different ranges of cells that contain data. Any help will be much appreciated.
    Last edited by instinctellekt; 06-07-2012 at 10:02 AM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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