Macro for deleting row with condition
Closed
obidankenobi
-
Jan 6, 2010 at 08:45 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Jan 6, 2010 at 09:36 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Jan 6, 2010 at 09:36 PM
Related:
- Macro for deleting row with condition
- Saints row 2 cheats - Guide
- How to delete a row in a table in word - Guide
- Spell number in excel without macro - Guide
- Deleting snapchat account - Guide
- Macro excel download - Download - Spreadsheets
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Jan 6, 2010 at 09:36 PM
Jan 6, 2010 at 09:36 PM
Your condition is confusing to me . I am rephrasingit
if a row contains either 103526 or 102527 or both thenf DO NOT delete
if neither of the two numbers is in a row delete
now as you are deleting the rows keep a copy of the data in sheet1 to sheet2 so that you can retiree the dta if there is mess up.
the data is in sheets 1
try this macro
please repost if there is any problem
if a row contains either 103526 or 102527 or both thenf DO NOT delete
if neither of the two numbers is in a row delete
now as you are deleting the rows keep a copy of the data in sheet1 to sheet2 so that you can retiree the dta if there is mess up.
the data is in sheets 1
try this macro
Sub test() Dim j As Integer, k As Integer Dim r As Range, cfind6 As Range, cfind7 As Range Worksheets("sheet1").Activate On Error Resume Next j = Cells(Rows.Count, "A").End(xlUp).Row For k = j To 1 Step -1 Set cfind6 = Rows(k).Cells.Find(what:=103526, lookat:=xlWhole) Set cfind7 = Rows(k).Cells.Find(what:=103527, lookat:=xlWhole) If cfind6 Is Nothing And cfind7 Is Nothing Then Rows(k).Delete Next
please repost if there is any problem