Macro for deleting a row with specific criteria in a cell
Closed
MacroNovice
Posts
2
Registration date
Tuesday 18 June 2013
Status
Member
Last seen
25 June 2013
-
18 Jun 2013 à 18:13
Blocked Profile - 26 Jun 2013 à 09:08
Blocked Profile - 26 Jun 2013 à 09:08
Related:
- Macro for deleting a row with specific criteria in a cell
- How do i find a specific video on youtube - Guide
- How to delete a row in word - Guide
- Saints row 2 cheats - Guide
- How to run a macro in excel - Guide
- Run Macros in Excel: online, shortcuts, VBA - Guide
2 responses
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
19 Jun 2013 à 21:25
19 Jun 2013 à 21:25
when you write a macro for deleting rows you loop from last row to first row and not reverse . rewrite macro
Good Morning.
If you just want to do as the previous poster had mentioned change the following lines in your macro:
MyCol = InputBox("Column to evaluate?", "Column Search", "FG")
MyVal = InputBox("Value to look for", "search value", 1)
For i = Range(MyCol & "65536").End(xlUp).Row to 1 Step -1
If Application.WorksheetFunction.CountIf(Range("A" & i & ":FZ" & i), MyVal) > 0 Then
Range("A" & i).EntireRow.Delete
End If
Hope this gets you closer.
If you just want to do as the previous poster had mentioned change the following lines in your macro:
MyCol = InputBox("Column to evaluate?", "Column Search", "FG")
MyVal = InputBox("Value to look for", "search value", 1)
For i = Range(MyCol & "65536").End(xlUp).Row to 1 Step -1
If Application.WorksheetFunction.CountIf(Range("A" & i & ":FZ" & i), MyVal) > 0 Then
Range("A" & i).EntireRow.Delete
End If
Hope this gets you closer.
25 Jun 2013 à 12:07