Sub KillStr() Dim Myrange As Range, DelRange As Range, C As Range Dim FirstAddress As String Dim MyStr, MyElm Columns("E:E").Select Selection.Delete Shift:=xlToLeft Columns("F:F").Select Selection.Delete Shift:=xlToLeft MyStr = Array("5GFI10", "5MAC20", "INT515", "5MAC15", "5MAC05", "5MAC10", "5TYC10", "5GVW10") Set Myrange = Intersect(ActiveSheet.UsedRange, Range("b2:b25000")) If Myrange Is Nothing Then Exit Sub Application.ScreenUpdating = False For Each MyElm In MyStr Set C = Myrange.Find(MyElm, Myrange.Cells(1), xlValues, xlPart) If Not C Is Nothing Then Set DelRange = C FirstAddress = C.Address Do Set C = Myrange.FindNext(C) Set DelRange = Union(DelRange, C) Loop While FirstAddress <> C.Address End If If Not DelRange Is Nothing Then DelRange.EntireRow.Delete Next MyElm
|Create Excel formula on dynamic data||5||35|
|ActiveX Listbox Multi Select in Excel 2010||8||20|
|Excel error Could not load some object becuae they are not available on this machine||5||8|
|Excel VBA - Use of double quotes in string||8||0|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
24 Experts available now in Live!