Morning all,
I have created a code that allows me to remove rows based on a certain criteria.
My limited VBA skills are now evident, as i need to extend this code across the entire workbook but have come a cropper!
The code is as follows:
Sub Delete_Rows()
Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("A16:W40000"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "Not current" _
Then
If del Is Nothing Then
Set del = cell
Else: Set del = Union(del, cell)
End If
End If
Next cell
On Error Resume Next
del.EntireRow.Delete
End Sub
How do i loop the code to cover multiple worksheets?
Any help would be greatly appreciated!
Thanks.
I have created a code that allows me to remove rows based on a certain criteria.
My limited VBA skills are now evident, as i need to extend this code across the entire workbook but have come a cropper!
The code is as follows:
Sub Delete_Rows()
Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("A16:W40000"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "Not current" _
Then
If del Is Nothing Then
Set del = cell
Else: Set del = Union(del, cell)
End If
End If
Next cell
On Error Resume Next
del.EntireRow.Delete
End Sub
How do i loop the code to cover multiple worksheets?
Any help would be greatly appreciated!
Thanks.