Lesson 24.2 Delete Blank Rows

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

ความคิดเห็น • 17

  • @adventureindia623
    @adventureindia623 3 ปีที่แล้ว

    Great Sir....Please keep the code at last in one frame of camera so that we can take picture for our reference and practice it.

  • @chrisschene8301
    @chrisschene8301 5 ปีที่แล้ว

    This is really great. Thanks. I purchased your excel file. Great stuff.
    I'd be more than happy to pay if you teach more advanced courses.

  • @ukaszsotkiewicz3879
    @ukaszsotkiewicz3879 4 ปีที่แล้ว +1

    I'm a beginner and your lessons are great, but I have to comment that it's mor efficient for code to avoid .select and selection. as much as possible, in this case you can just type: Cells(xrow, 1).EntireRow.Delete

  • @salimbsc
    @salimbsc 4 ปีที่แล้ว

    If I have to search two values and delete them what should I do?

  • @chadiabou-ghayda8276
    @chadiabou-ghayda8276 2 ปีที่แล้ว

    The problem i am having is that the empty rows i have are zero value based on formula.
    so , when i ma using the code , its deleting every thing. any advise.
    My 1st row is row 8
    this is the code i am using
    Sub Delete_Rows()
    Dim lastrow As Long, xrow As Long
    xrow = 8

    lastrow = Range("a400").End(xlUp).row
    Do Until xrow = lastrow
    If Cells(xrow, 8).Value = "" Then
    Cells(xrow, 8).Select
    Selection.EntireRow.Delete
    xrow = xrow - 1
    lastrow = lastrow - 1
    End If
    xrow = xrow + 1
    Loop
    End Sub

  • @abdulhamidalhaddadi2255
    @abdulhamidalhaddadi2255 4 ปีที่แล้ว

    Thank you very much.
    Sir, how can I apply it to multiple sheets?
    I want to delete 1 Row and 3 Columns only.
    Thanks again

  • @djtoomey1264
    @djtoomey1264 6 ปีที่แล้ว

    Another great video, thanks.

  • @manikandaniyer8570
    @manikandaniyer8570 5 ปีที่แล้ว +1

    M getting runtime error 1004

    • @makupaku91
      @makupaku91 5 ปีที่แล้ว

      I'm getting the same error.. Someone help lol

  • @Love.Indians
    @Love.Indians 4 ปีที่แล้ว

    today i did learn one new think

  • @leixia6415
    @leixia6415 6 ปีที่แล้ว +1

    conditions are not hard, it's those "Objects.operations"(e.g. Cells.Select) that I never seen before.

  • @gi-mingwang1297
    @gi-mingwang1297 7 ปีที่แล้ว

    Thanks a lot!

  • @1982why
    @1982why 5 ปีที่แล้ว

    Hi,I already do as what u writebut error lastrow = Range("A50000").End(x1up).Rowwhat problem,where I do mistake?Sub DeleteBlankRows()
    Dim lastrow As Long, xrow As Long
    xrow = 1'finds last cell in column A with data
    lastrow = Range("A50000").End(x1up).RowDo Until xrow = lastrow If Cells(xrow, 1).Value = "" Then
    Cells(xrow, 1).Select
    Selection.EntireRow.Delete xrow = xrow - 1
    lastrow = lastrow - 1End If
    xrow = xrow + 1
    LoopEnd Sub

  • @aashiq9856
    @aashiq9856 6 ปีที่แล้ว

    How this is helpful when excel has filter option?

  • @abc999958
    @abc999958 4 ปีที่แล้ว

    'For deleting blank columns.
    Sub deleteBlankCoumns()
    Dim Xcol As Long, LastCol As Long
    Sheets("Loops").Select
    Xcol = 1
    LastCol = Range("XFD1").End(xlToLeft).Column
    Do Until Xcol = LastCol
    If Cells(1, Xcol).Value = "" Then
    Cells(1, Xcol).Select
    Selection.EntireColumn.Delete
    Xcol = Xcol - 1
    LastCol = LastCol - 1
    End If

    Xcol = Xcol + 1
    Loop
    End Sub

  • @hidingindanielsroom7268
    @hidingindanielsroom7268 5 ปีที่แล้ว

    Sub delRow()
    Dim lastRow As Long
    lastRow = Range("a900000").End(xlUp).Row
    Do Until lastRow = 1
    If Cells(lastRow, 1) = "" Then
    Rows(lastRow).Delete
    End If
    lastRow = lastRow - 1
    Loop
    End Sub

  • @mohamdalmhde1322
    @mohamdalmhde1322 6 ปีที่แล้ว

    Thanks a lot!