Re: $$Excel-Macros$$ Re: Pls tell me more about Areas Property of the Range

2012-07-30 Thread Sam Mathai Chacko
Not necessarily a Union function. Even if you select two ranges of cells using the CTRL key, and then say Selection.Areas.Count, it will give the number of selections made as different groups of cells. Regards, Sam On Mon, Jul 30, 2012 at 9:25 PM, Prince Dubey wrote: > Hi Sam, > > > Thanks for y

$$Excel-Macros$$ Re: Pls tell me more about Areas Property of the Range

2012-07-30 Thread Prince Dubey
Hi Sam, Thanks for your help .As i saw the result i guess that Areas property return cluster of range when there is a range created by using union function. regards prince On Sunday, 29 July 2012 00:28:46 UTC+5:30, Prince Dubey wrote: > > Hi All, > > > I want to know more about Areas proper

Re: $$Excel-Macros$$ Re: Pls tell me more about Areas Property of the Range

2012-07-29 Thread Sam Mathai Chacko
variable rng used as obj.. revised Sub T() Dim rngCluster As Range Dim rng As Range Set rngCluster = Application.Union(Range("A1:C3"), Range("D5:E10")) For Each rng In rngCluster.Areas MsgBox rng.Address Next rng End Sub On Sun, Jul 29, 2012 at 5:05 PM, Sam Math

Re: $$Excel-Macros$$ Re: Pls tell me more about Areas Property of the Range

2012-07-29 Thread Sam Mathai Chacko
Prince, I missed the part about selecting to contiguous cell groups. And come to think of it, it doesn't necessarily have to be non-empty. Try this Sub T() Dim rngCluster As Range Dim rng As Range Set rngCluster = Application.Union(Range("A1:C3"), Range("D5:E10")) MsgBox rngClu

$$Excel-Macros$$ Re: Pls tell me more about Areas Property of the Range

2012-07-29 Thread Prince Dubey
Hi Sam, Thanks for the reply, I did the same as you have mentioned in your post i created a range A1:E9 in which i inserted data from A1:C3 and then D5:E9 and i wrote Sheet1.range(A1:E9).Areas(1).Address but it returned $A$1:$E$9 as address and in case of Sheet1.range(A1:E9).Areas(1).count it