Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: DELETE ROWS BASED ON BLANK CELLS IN COL "A"

  1. #11
    Board Regular
    Join Date
    Dec 2010
    Location
    Dallas, TX
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: DELETE ROWS BASED ON BLANK CELLS IN COL "A"

    Quote Originally Posted by NateO View Post
    This is fairly quick:

    Code:
    Sub deltime2()
    [a:a].SpecialCells(xlCellTypeBlanks).EntireRow.delete
    End Sub
    Hope this helps.
    I tried using this code for multiple sheets and it doesn't work. I got it to run on just one sheet, but it won't work on multiple sheets. Any suggestions?

    Code:
    Sheets("IMPORTANT").Select
    Call deltime2
    Sheets("Overview").Select
    Call deltime2

  2. #12
    Board Regular
    Join Date
    Apr 2010
    Posts
    279
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: DELETE ROWS BASED ON BLANK CELLS IN COL "A"

    I think you need .activate instead of .select

    Code:
    Sheets("IMPORTANT").Activate
    deltime2
    Sheets("Overview").Activate
    deltime2
    That being said, do you want to do this on every sheet? You could make it loop through every sheet and perform the action without ever having to select/activate a range.
    Last edited by SaladProblems; Dec 3rd, 2010 at 12:20 PM.

  3. #13
    Board Regular
    Join Date
    Dec 2010
    Location
    Dallas, TX
    Posts
    73
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: DELETE ROWS BASED ON BLANK CELLS IN COL "A"

    I would like to do it on every sheet. Not sure how to loop through sheets though. Still learning vba.

  4. #14
    Board Regular
    Join Date
    Apr 2010
    Posts
    279
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: DELETE ROWS BASED ON BLANK CELLS IN COL "A"

    Code:
    Sub Clean()
    
    Dim WS As Worksheet
    
    For Each WS In ActiveWorkbook.Worksheets
            
        WS.Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
        On Error Resume Next
        
        Next
    
    End Sub
    See if this works. Be sure to save your data first, just in case.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •