Union of several ranges
Posted by Ron Dionne on November 01, 2001 8:00 AM
I'd like to take several ranges from different sheets
and join them together into one big range. The union
method seems to be what I need to use, but I get an
error when trying to use it with this code:
For j = 1 To finalWB.Worksheets.Count
With finalWB.Worksheets(j)
Set bigRange(j) = .Range(.Cells(RowOffset + 1, 3), .Cells(NumRows, 3))
End With
Next
For m = 1 To NumFiles
Set totalRange = Application.Union(totalRange, bigRange(m))
Next
The number of ranges (files) I need to join together is
variable. Help please.