Can Someone help me out with a macro.
I need a macro to delete all rows with the data "06 - DEAD" in column H
Would really appreciate if someone could help me out with this.
Can Someone help me out with a macro.
I need a macro to delete all rows with the data "06 - DEAD" in column H
Would really appreciate if someone could help me out with this.
Try
VBA Noob![]()
Sub DeleteColH() Columns("H:H").AutoFilter Field:=1, Criteria1:="06 - DEAD" Range("H1").Offset(1, 0).Resize(Cells(Rows.Count, "H").End(xlUp).Row) _ .EntireRow.Delete ActiveSheet.AutoFilterMode = False End Sub
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Or Royuk likes using the below union method
VBA Noob![]()
Sub deleteRows() Dim cl As Range Dim rng As Range Dim R As Long Dim X As Long R = ActiveSheet.Cells(Rows.Count, "H").End(xlUp).Row For X = 1 To R If Not IsEmpty(Cells(X, "H")) And Cells(X, "H").Value = "06 - DEAD" Then If rng Is Nothing Then Set rng = Cells(X, "H") Else: Set rng = Union(rng, Cells(X, "H")) End If End If Next X rng.EntireRow.Delete End Sub
Hi Noob
Your code should be pretty quick so long as the data is in a filterable format.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Thanks a lot!!!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks