Macro to delete row after certain condition found
Solved/Closed
wendelly
wendelly
- Posts
- 4
- Registration date
- Thursday April 3, 2014
- Status
- Member
- Last seen
- April 4, 2014
wendelly
- Posts
- 4
- Registration date
- Thursday April 3, 2014
- Status
- Member
- Last seen
- April 4, 2014
Related:
- Macro to delete row after certain condition found
- Macros to Delete Rows in Excel 2007 ✓ - Forum - Programming
- Macro to compare and delete rows ✓ - Forum - Excel
- Conditionally deleting rows in excel 2007 ✓ - Forum - Excel
- Excel Macro for deleting rows IF cells not... ✓ - Forum - Excel
- Macro that copy/pastes rows based on a certain condition on SAME sheet. ✓ - Forum - Excel
5 replies
aquarelle
Apr 4, 2014 at 12:02 PM
- Posts
- 7104
- Registration date
- Saturday April 7, 2007
- Status
- Anonymous
- Last seen
- May 24, 2022
Apr 4, 2014 at 12:02 PM
I presumed that there were titles on the Row 1, put this macro on the sheet you want to use it, in VBA project :
Regards
Public Sub DeleteRowIfCellZero_ColD() Dim x As Long Dim y As Long x = Range("D65536").End(xlUp).Row For y = x To 2 Step -1 If Cells(y, 4).Value = 0 Then Rows(y + 1).EntireRow.Delete End If Next y End Sub
Regards
aquarelle
Apr 4, 2014 at 09:30 AM
- Posts
- 7104
- Registration date
- Saturday April 7, 2007
- Status
- Anonymous
- Last seen
- May 24, 2022
Apr 4, 2014 at 09:30 AM
Hello,
Which column? Everytime the same column or not?
Regards
Which column? Everytime the same column or not?
Regards
wendelly
Apr 4, 2014 at 10:09 AM
- Posts
- 4
- Registration date
- Thursday April 3, 2014
- Status
- Member
- Last seen
- April 4, 2014
Apr 4, 2014 at 10:09 AM
Hello, it would be the same column every time. Thanks.
aquarelle
Apr 4, 2014 at 10:16 AM
- Posts
- 7104
- Registration date
- Saturday April 7, 2007
- Status
- Anonymous
- Last seen
- May 24, 2022
Apr 4, 2014 at 10:16 AM
Which? A B C...?
wendelly
Apr 4, 2014 at 10:45 AM
- Posts
- 4
- Registration date
- Thursday April 3, 2014
- Status
- Member
- Last seen
- April 4, 2014
Apr 4, 2014 at 10:45 AM
It would be column D.
Didn't find the answer you are looking for?
Ask a question
wendelly
Apr 4, 2014 at 03:23 PM
- Posts
- 4
- Registration date
- Thursday April 3, 2014
- Status
- Member
- Last seen
- April 4, 2014
Apr 4, 2014 at 03:23 PM
That worked brilliantly. Thanks.