+ Reply to Thread
Results 1 to 5 of 5

if cell is blank delete entire row

  1. #1
    Registered User
    Join Date
    02-24-2012
    Location
    Findlay, OH
    MS-Off Ver
    Excel 2007
    Posts
    33

    if cell is blank delete entire row

    In Macro QI and Macro QIFRH, I have this line and it is erroring out. Above in this macro I have it sorting because when it copies to the next sheet people will be entering data so I need the rows to line up with that data correctly. When I have Column g:g on the Macro QI if works fine. If just won't work in Column f:f. In Macro QIFRH it works fine if it is column F:F and doesn't work for column G:G.

    See Attachment

    Columns("g:g").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    Attached Files Attached Files

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: if cell is blank delete entire row

    Hi, thuddleston11,

    if no empty cells are involved or the entire column is empty the error is raised. You may work around it like
    Please Login or Register  to view this content.
    IŽd recommend to narrow down the size from a whole column to just the used range and work a bit on the code for QI:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    02-24-2012
    Location
    Findlay, OH
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: if cell is blank delete entire row

    I tried this suggestion and I can't get it to work. It will work on Column g:g but if I change it to F:F it doesn't work. Not sure what I am doing wrong.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: if cell is blank delete entire row

    Hi, thuddleston11,

    do you mind to read what started my post?
    if no empty cells are involved or the entire column is empty the error is raised.
    Maybe you could tell me how many empty cells you find in Column F in the used range (F1:F983)? Can we agree on 982 which means all cells except the header are empty? You just copy a header over from Sheet QI to Birchaven and then copy that range to SW... - with the sample supplied that doesnŽt make a lot of sense to me to work with blank cells in Column F on SW....

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    02-24-2012
    Location
    Findlay, OH
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: if cell is blank delete entire row

    Maybe I was not clear. The macro is for the tab SW-Birchaven REF. I do agree with your first statement on column F for the import tab. What I was trying to say is that on the SW-Birchaven REF tab that I want column F to delete rows if column F is empty. This macro will work on Column G but not F. I don't know why. Sorry I was not clear before.

    Terrie

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Delete entire row if column F is blank
    By ScabbyDog in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-21-2013, 11:03 AM
  2. Replies: 1
    Last Post: 05-10-2012, 04:58 PM
  3. delete entire blank rows
    By isabella in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-18-2010, 09:07 PM
  4. Delete entire row if criteria cell is blank
    By sammar12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2008, 10:09 AM
  5. If cell in column B is blank, delete entire row
    By davehunter in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-03-2007, 06:38 AM

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