+ Reply to Thread
Results 1 to 6 of 6

Delete Entrie Row if entries in Column C are Blank

  1. #1
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Delete Entrie Row if entries in Column C are Blank

    I have a data from Column A through E (Rows 1:500).

    I want to delete the entire Row if a particular cell in column C is blank.

    For E,g. if cell C5 is blank, I want the whole of Row 5 to get deleted.

    I have already written a code, however it is not working.
    Please Login or Register  to view this content.
    Can any one tell what is wrong with it?
    Cheers!
    Deep Dave

  2. #2
    Valued Forum Contributor wenqq3's Avatar
    Join Date
    04-01-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    868

    Re: Delete Entrie Row if entries in Column C are Blank

    Please Login or Register  to view this content.
    Hope it help
    -If the problem is solved, please mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved".

    -Always upload a workbook before start your question
    To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.

    +++ If my answer(s) helped you, please add me reputation by click on * +++

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Delete Entrie Row if entries in Column C are Blank

    hi there~ here are a few things to consider:
    1. does Column A determine where the last row is? if not, please change LastRow to:
    Please Login or Register  to view this content.
    2. to delete or insert rows, it's better to work backwards with the For Next Loop. for eg. if you have blanks in C2 & C3. then your original loop will delete row 2. after deleting, C3 becomes C2. but your loop will jump to check C3 now & miss out C2. so:
    Please Login or Register  to view this content.
    3. do not use:
    Please Login or Register  to view this content.
    the activecell could be anywhere. the loop does not select the cell. it just checks internally. so use:
    Please Login or Register  to view this content.
    4. you can't use:
    Please Login or Register  to view this content.
    either
    Please Login or Register  to view this content.
    or:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: Delete Entrie Row if entries in Column C are Blank

    @benishiryo

    Thank you for the inputs.. It really helped..

    Regarding Point 1 - I have specified "A", as Column A determines my Last Row.

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: Delete Entrie Row if entries in Column C are Blank

    @wenqq3

    Thank You for the code.. It worked perfectly..

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,876

    Re: Delete Entrie Row if entries in Column C are Blank

    @Benishiriyo

    Hey!!

    1 Thing I cud not understand is why did you use For Counter = LastRow To 2 Step -1

    I saw your clarification which I was able to understand. However I could not understand how "For Counter = LastRow To 2 Step -1" achieves the same result as "For Counter = 2 To LastRow" this does.

    Can you please clarify in brief so that I can understand the code I am using?

    I'd be really grateful..

+ 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