Thread: Range Problem
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Barb Reinhardt
 
Posts: n/a
Default Range Problem

Could it be this line. E:10:E25 ???


Set rng1 = _
Application.Union(Range("E:10:E25"), Range("G10:G25"))


"jesmin" wrote in
message ...

Hi: I am selecting 2 ranges formed by union. 1 is working and other is
NOT.
----Code:
Dim rng1, rng2, rngt As Variant
dim l1,l2 as variant
Set rng1 = _
Application.Union(Range("E:10:E25"), Range("G10:G25"))
rng1.FormulaR1C1 = "=RC[-3]"
Set rngt = Application.Union(Range("C11:c25"), rng1)

Set rng2 = _
Application.Union(Range("B10:B25), Range("D10:D25"))

l1 = Application.WorksheetFunction.Max(rng2)
Cells.Find(What = l1).Activate------working fine

l2 = Application.WorksheetFunction.Max(rngt)
Cells.Find(What = l2).Activate------Error: Object or With block not set


Why the 1st is working but no the 2nd one.

Thanks in advance


--
jesmin
------------------------------------------------------------------------
jesmin's Profile:
http://www.excelforum.com/member.php...o&userid=29540
View this thread: http://www.excelforum.com/showthread...hreadid=492932