Excel VBA to Delete Rows if Cell is Blank - Delete Rows Based on Cell Value - Code Included

This Excel VBA Tutorial explains VBA Code to delete rows when cell is blank. You can use For Loop with If Condition to write VBA code to delete rows based on cell value condition.
VBA Code , used in this example is as follows :
a = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To a
If Worksheets("Sheet1").Cells(i, 3).Value = "" Then
Rows(i).Delete
End If
Next

Пікірлер: 29

  • @vv9730
    @vv97302 жыл бұрын

    THANKS A LOT..THIS VIDEO HELPED ME A LOT...!!!

  • @silverlicious2086
    @silverlicious20863 жыл бұрын

    Good example. Thank you for all your effort.

  • @ExcelDestination

    @ExcelDestination

    3 жыл бұрын

    Glad it was helpful!

  • @MohAboAbdo
    @MohAboAbdo3 жыл бұрын

    Thank you so Mitch, Sur.

  • @ExcelDestination

    @ExcelDestination

    3 жыл бұрын

    Welcome!

  • @kishormandal3560
    @kishormandal3560 Жыл бұрын

    Thank you 💗💛

  • @bryonlim3183
    @bryonlim3183 Жыл бұрын

    Thanks!

  • @mahendraprajapati9809
    @mahendraprajapati9809 Жыл бұрын

    Thank you

  • @AnilKumar-tm6fq
    @AnilKumar-tm6fq3 жыл бұрын

    Sir it's really helpful I searched have many videos still little bit helps I will try if not I will ask you.

  • @tannertucker22
    @tannertucker223 жыл бұрын

    Thank you very much. What I think would be very helpful is if the deleted row and cell value were copied to another worksheet. This way someone can use the worksheet with the rows containing the missing data to find the missing data.

  • @ExcelDestination

    @ExcelDestination

    3 жыл бұрын

    yes, that's a good thought.

  • @tannertucker22

    @tannertucker22

    3 жыл бұрын

    @@ExcelDestination i am an auditor. Auditor always want to know what is missing.

  • @tannertucker22

    @tannertucker22

    3 жыл бұрын

    Even better. Shade blank cells yellow or any color within the current region. Then delete any row with a blank cell. The paste to new worksheet. No you have a worksheet that a user can find the missing data with the cells (Formatted) shaded that require data.

  • @alvingapay2592
    @alvingapay25922 жыл бұрын

    Hi Sir, this is a good video! Sir how about if you want to delete multiple values in a column like blanks, delhi and pune? Thanks and more video to teach and inspire others.

  • @shalinigupta1419
    @shalinigupta14193 жыл бұрын

    Good

  • @kldrhmn8324
    @kldrhmn83243 жыл бұрын

    Thank you for the video can you please to show how to delete the entire empty row based on the entire empty cells row (not based on the first empty cell) because there some data gets lost

  • @jiya2907
    @jiya290711 ай бұрын

    One row selected not blanked cell that one row delete, pls help me sir... This for my own created sales sheet row line k13 to p13 after row using to this

  • @rajeshrawat2512
    @rajeshrawat2512 Жыл бұрын

    sir how to copy non blank rows in new sheet for multiple column in data set

  • @1982degoel
    @1982degoel Жыл бұрын

    is it possible to delete just one cell 9not entire row )based on cell value

  • @asonayaz
    @asonayaz3 жыл бұрын

    Can you delete any row where the sum of any row equal zero?

  • @ExcelDestination

    @ExcelDestination

    3 жыл бұрын

    yes, we can do that. some additional code is required to check sum before deleting row.

  • @aathifts280
    @aathifts28011 ай бұрын

    The problem in this approach is when there multiple empty values it should delete one and move to next

  • @samiawad504
    @samiawad504Ай бұрын

    Need code to delete only if the whole row is empty not cell

  • @krutikalimje9186
    @krutikalimje91862 жыл бұрын

    Not working for me

  • @SanviPatil2019
    @SanviPatil2019 Жыл бұрын

    Here, how we can delete non blank rows..

  • @sajitht7246
    @sajitht72462 жыл бұрын

    IT IS NOT WORKING IF THERE IS CONTINUES BLANKS REPEATS

  • @ABCEE1000
    @ABCEE10002 жыл бұрын

    too complicated tho

  • @shaileshrane8542
    @shaileshrane85422 жыл бұрын

    NOT WORKING

  • @ilkergencel9800
    @ilkergencel98002 жыл бұрын

    it is very useful however, I have a table copying from 1 book to another book and finally I want to delete empty rows from the 2nd table. I tried your method but not working for me. Private Sub CommandButton1_Click() a = Worksheets("hedef.xlsm").Cells(Rows.Count, 1).End(xlUp).Row For i = 2 To a If Worksheets("hedef.xlsm").Cells(i, 3).Value = "" Then Rows(i).Delete End If Next End Sub can you please advise?