As Rory said, in Excel, an Area is a contiguous range of cells . This can be "got at" in VBA throught the Areas Collection Object.
A Range Object is more often than not a contiguous range of cells ( so that is a typical VBA guess as its "Implicit default" thingy** ). But it does not have to be. It is not defined as such; A Range Object can be a non contiguous range of cells:
A Range Object is a group of cells in a worksheet. The list of the cells of the range is organised in rectangular groups of cells, each one named an Area. ( Can be reffered to by its Item Number, counting, I believe in the order they were added )
I believe when you do something like this ( Where rng is a Range Object )
______rng._____ =
Then that Implicitly defaults to the first Area**
______rng. Areas.Item(1).______ =
_ .. try it .. just add that bit in any code you have, - it does no harm ( well might **** some people off )
You can build up the Areas using the Union Method
Somethings will not "appear" to "work" for you on a Range built with the Union. Or they may only appear to "work" on the first Area you added. That is usually because the code line you write defaults to the first Area, so just applies to that first Area.
I think you usually need to loop through to apply things to all Areas. For example this sort of thing
___For Each rgCell In rgUnion
___ _........_...
___ _...
___Next
is the quickest I believe.
But I think some things will work in "one go" on the Unioned Range Object, as an example:
rgUnion.Interior.Color = vbRed
Rem Ref
http://www.eileenslounge.com/viewtop...181736#p181655
Post #27 http://www.mrexcel.com/forum/excel-q...-column-3.html
Bill Gelatine
Bookmarks