sitewolf
Active Member
- Joined
- May 4, 2012
- Messages
- 304
OK, maybe I'm just not awake enough today, but I also should know more VBA than I do
I'm using VBA to delete entire rows if a specific column/cell is blank- that part is fine.
I'm using Dim rng As Range, cell As Range, del As Range.....
But after that I'd like to delete entire rows if a different column/cell is blank
What do I need to rename to be able to do both?
I thought I could just go to rng2 or something...
"Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("b1:b70000"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "" _
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"
I'm using VBA to delete entire rows if a specific column/cell is blank- that part is fine.
I'm using Dim rng As Range, cell As Range, del As Range.....
But after that I'd like to delete entire rows if a different column/cell is blank
What do I need to rename to be able to do both?
I thought I could just go to rng2 or something...
"Dim rng As Range, cell As Range, del As Range
Set rng = Intersect(Range("b1:b70000"), ActiveSheet.UsedRange)
For Each cell In rng
If (cell.Value) = "" _
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"