+ Reply to Thread
Results 1 to 2 of 2

Delete empty rows with cell type 2

  1. #1
    Registered User
    Join Date
    05-03-2006
    Posts
    1

    Question Delete empty rows with cell type 2

    I'm using the following macro to copy the columns A:R to a new sheet. In this new sheet the empty rows are deleted. These rows are determined by any empty cells in column E.

    Sub copypaste()

    Columns("A:R").Select
    Selection.Copy
    Sheets("RowsDeleted").Select
    Range("A1").Select
    ActiveSheet.Paste

    Columns("E:E").Select

    On Error Resume Next
    Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    ActiveSheet.UsedRange

    End Sub


    The problem I'm having is that it only deletes the rows where the cell in column E is a number (cell type 1), but I want it to also remove the empty cells with cell type 2 (text).

    I tried to use other columns but the have the same problem.

    Does anybody have a solution?

    thanks

  2. #2
    Pete_UK
    Guest

    Re: Delete empty rows with cell type 2

    Within your macro you could set up a filter on column E, choose the
    criteria, then Edit | Delete Row and remove the filter. You could
    record a macro while you do this manually (to get the syntax), then
    copy it over to your other macro.

    Hope this helps.

    Pete


+ 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