delete complete set of row if 124124 is there anywhere in the row in each set

I want to delete complete set of row  if 124124 is there anywhere in the row in each set
this highlighted colour is only for understanding purpose
Avinash SinghAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Try the macro in Module1.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Or you may try something like this...

Sub DeleteRows()
Dim lr As Long, lc As Long
Dim Rng As Range, delRng As Range
lr = Cells(Rows.Count, 1).End(xlUp).Row
lc = ActiveSheet.UsedRange.Columns.Count

For Each Rng In Range("A1:A" & lr).SpecialCells(xlCellTypeConstants, 1).Areas
    If Application.CountIf(Rng.Resize(, lc), "124124") > 0 Then
        If delRng Is Nothing Then
            Set delRng = Rng.Resize(Rng.Cells.Count + 1)
            Set delRng = Union(delRng, Rng.Resize(Rng.Cells.Count + 1))
        End If
    End If
Next Rng
If Not delRng Is Nothing Then
End If
End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Avinash SinghAuthor Commented:
Thnx Martin liss Sir and Thnx Neeraj sir for ur great support and giving ur precious time to this post
Martin LissOlder than dirtCommented:
You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography” section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
              Experts Exchange Top Expert VBA (current)
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Avinash!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.