Thread: range offset
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Douvid Douvid is offline
external usenet poster
 
Posts: 11
Default range offset

Patrick,
The thing is that I need to autofill the added column.So I
need to provide a destination range which has to be in the
new column starting at the row the named range start
untill it ends. But the range is always different. Am I
understandable ?

-----Original Message-----
Make sure that the original range is range named. Then
when you insert a column, the named range will shift too.

to access the first column, just point to it

for example

dim cell as range

for each cell in Range("MyRange").Columns(1).Cells
'''
Next

or
Dim rCol1 as Range
SET rCol1 = Range("MyRange").Columns(1)


Patrick Molloy
Microsoft Excel MVP












-----Original Message-----
Hi,
I have a range, I'm adding a column before the first one
of the range then I need to select a specific range in
that new column according to the first selected range.
Lets say my original range was A2:B5, now the new column
is becoming A and my original range (B2:C5), so how do I
select in that column the range of rows corresponding to
the original range (A2:A5)??
Using the range.offset synthax is selecting a new range

of
the size of the original one but I need less than that.
Can someone light my way for that one ???
TKS
.

.