View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Working with a range within a range ?

You can use the intersect function which gives you the intersection of two
ranges.

Sub SubRange()
Dim rngLarge As Range
Dim rngSmall As Range

Set rngLarge = Sheet1.Range("A1:D10")

Set rngSmall = Intersect(Sheet1.Range("A1").EntireColumn, rngLarge)
rngSmall.Select

End Sub

You can modify this as is necessary. I made some specific references.

HTH

"Dan Thompson" wrote:

I am trying to assing a sub range within a larger range of cells on a
worksheet.
I would like to be able to assign this smaller sub range within the larger
range of cells on my worksheet by just designating wich column within the
larger range should be used for the smaller range and the rest of the
paramiters such as number of rows for the smaller range should be taken from
the range paramiters of the larger range.

Set LRange = Worksheets("Sheet1").Range("A1:D10")

Set SRange = Range(LRange.Columns(1)) <-- This works but only gives me a
range of "A1" I need it to be "A1:A10"

anyone ????

Thanks again
Dan Thompson