rickyyy2006
New Member
- Joined
- Nov 21, 2016
- Messages
- 8
Code:
Sub DeleteSettleHKDDebitAccount()
Dim checkrow As Long, lastrow As Long
With Worksheets
lastrow = Worksheets("借出-港幣").Cells(Rows.Count, "A").End(xlUp).Row
For checkrow = 3 To lastrow
If Worksheets("借出-港幣").Cells(checkrow, "F") <> "" Then
Worksheets("借出-港幣").Cells(checkrow, "A").EntireRow.Delete
End If
Next checkrow
End With
End Sub
The 3 steps of my action: Imgur: The most awesome images on the Internet
So, my situation is when i click the second button, that is the lower button, it deleted row 4 and row 6. Yet, it didn't delete row 5. I need to click the button again, then it deleted row 5.
My question is why do i need to click twice to delete this 3 rows? My expectation is that i only need to click the lower button once, then it will delete all the rows with a letter "Y" in the column F.
I checked my code however i still don't know why. Can anyone help me?
Thanks a lot
Last edited: