Hey all,
I am attempting to remove certain cells from a range that I have previously defined. I've come up with a way to do this but I'm wondering if there's an easier way. Here is what I have:
Dim startingRange As Range
Dim subtractRange As Range
Dim cell As Range
Dim newRange As Range
Set startingRange = Range("A1:A10")
Set subtractRange = Range("A6:A10")
Set newRange = Nothing
For each cell in startingRange
If intersect(cell,subtractRange) Is Nothing Then
If newRange Is Nothing Then
Set newRange = cell
Else
Set newRange = Union(newRange,cell)
End If
End If
Next cell
Like I said, this works but it seems like there should be a more efficient way. Any thoughts?
Bookmarks