Repost: Removing Cells from a Range
How aabout re-creating the range, but excluding the part you want to remove?
Function outpt(inpt As Range, remove As Range) As Range
Dim r As Range
For Each r In inpt
If Intersect(r, remove) Is Nothing Then
If outpt Is Nothing Then
Set outpt = r
Else
Set outpt = Union(r, outpt)
End If
End If
Next
End Function
just concept code - untested
--
Gary''s Student
"Anton" wrote:
As I must have been unclear in my previous post Ill try again: How can one
re-size a range object? What I want to do is successively shrink the range
of cells that are used by a macro that I work on. The macro successively
searches for IDs in a specified range of cells, and if an ID is found then I
want to remove that cell from the range so that it is no longer part of
further rounds of searching. But as I dont want to modify the worksheet
Range.Delete doesnt work for me.
Id appreciate any help in solving this problem.
Anton
|