+ Reply to Thread
Results 1 to 6 of 6

Macro to delete rows in column C

  1. #1
    Forum Contributor
    Join Date
    08-22-2005
    MS-Off Ver
    Office 365
    Posts
    342

    Macro to delete rows in column C

    Hello Excel Guru's


    I have a worksheet that has 3 columns.

    Column A, Column B and Column C

    Long story short I am looking for a Macro that will look at Column C and if there is a blank cell (In column C) delete row.

    If you need the long story with more facts to make the Macro work read further.

    • There are numbers, text in the rows A2:A100 and B2:B100 for Column A & B, however in the rows C2:C100 under Column C there will only be a date format as such - Date: 01/08/13
    • There could be some rows that do not have a date under Column C
    • The date will run between : Date: 01/01/13 to Date: 07/31/13

    So the rows under column C will either blank or Date: xx/xx/xx (range of dates above)

    I would like to have a Macro that will look at column C and delete all rows that are blank.


    Let me know if you need anything else.

    Thanks in advance.
    Last edited by SVTF; 08-04-2013 at 06:21 PM.

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

    Re: Macro to delete rows in column C

    Hi, SVTF,

    if the cells are really blanks you could try

    Please Login or Register  to view this content.
    where you should check the column with constant data (here Column A). This will delete the entire row!

    And why only gurus? There are more people around in this forum who are more than able to answer your question although they do not have the level of a guru

    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
    Forum Contributor
    Join Date
    08-22-2005
    MS-Off Ver
    Office 365
    Posts
    342

    Re: Macro to delete rows in column C

    Holger,

    When I try to run the above it returns - No blanks found in Column C - But there is.
    I only have a date entered on 4 rows of 10 in Column C

    A Guru .. is anyone better than me

    Any other thoughts ... Sometimes there are blank cells in Column A and B as well.

    But this just all has to be based of C

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,008

    Re: Macro to delete rows in column C

    Another option, but Holger's looks better.

    It does, however, need a slight change (typo):

    Please Login or Register  to view this content.


    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Contributor
    Join Date
    08-22-2005
    MS-Off Ver
    Office 365
    Posts
    342

    Re: Macro to delete rows in column C

    Thanks to Holger and TMShucks

    Works like a charm.
    Last edited by SVTF; 08-04-2013 at 06:23 PM.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,008

    Re: Macro to delete rows in column C

    You're welcome. Thanks for the rep.

+ 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. VBA Code to Delete Rows in One Target Worksheet Based on Value Found in One Column
    By Aimeeeshaw in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-16-2013, 12:15 PM
  2. Macro to delete certain columns and delete rows based on time in another column
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2012, 11:47 AM
  3. Replies: 3
    Last Post: 04-19-2012, 10:45 AM
  4. How to delete rows based on matching code?
    By jp001 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-06-2010, 07:09 PM
  5. Code to delete rows based on status code in Column I
    By LemonTwist in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2009, 07:01 PM

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