+ Reply to Thread
Results 1 to 4 of 4

Macro to Delete if cell empty

  1. #1
    Daywalker
    Guest

    Macro to Delete if cell empty

    Hi,

    I've been searching all morning for a macro that will look at a sheet of data, and then look at a specific column, then if the cell is empty, delete the full row.

    Came across the below which I tried to modify (as below), but its not really working. I also have the cells set up with a "Conditional Format", which I'm usure if that is stopping it deleting also.

    Anyone help ?

    -----------------------------------------------------------------------

    Please Login or Register  to view this content.
    -------------------------------------------------------------------------
    Last edited by mudraker; 10-06-2007 at 08:32 AM.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    What do you actually mean by 'not really working?'
    Martin

  3. #3
    Daywalker
    Guest

    Delete Row

    Hi Martin,

    What its actually doing, is deleteing the header row, but the rest of the cells that have no data in them (column H), it's not deleting them. Thats why I started to think it might be cause I have the cells set up with a "Conditional Format" ?.

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    The problem is being caused by you looking for the last row used row i column H. If column H is vacant apart for the header in row 1 then your macro will only loop for row 1

    You will need to change the column letter for this line of code
    Please Login or Register  to view this content.
    or use this

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

+ 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