View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default select a range w/in a range

Sub AAA()
Dim row1 As Long, row_y As Long
Dim col_x As Long
Dim rng1 As Range, rng2 As Range
Dim rng3 As Range
row1 = 3
row_y = 7
col_x = 2
Set rng1 = Range("named_rng_x")
Set rng2 = rng1(row1, col_x)
Set rng3 = rng1(row_y, col_x)
rng1.Parent.Select
Union(rng2, rng3).Select
End Sub

--
Regards,
Tom Ogilvy


"Zb Kornecki" wrote:

Hi I have a maro w/ a named range from which I need to select 2 Nonadjacent
rows based on variables but can't seem to get the code right. I need to
select row$1, col_x and row_y, col_x of named_rng_z.

any help w/ the syntax would be appriciated

Zb Kornecki