View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Defining Range with Relative R[1]C[1] notation

No, if you want to select a larger range as you describe, then, by default,
when the selection is made, the first cell in the range is made the active
cell.

If you are concerned about speed, then you shouldn't be selecting at all.

The fast way to seach down column C is

Dim cell as Range, rng as Range, rng1 as Range
set rng = Range(Cells(1,"C"),Cells(rows.count,"C").End(xlup) )
for each cell in rng
set rng1 = cell.Offset(0,-2).Resize(1,6)
' now work with rng

' you see no time is spent selecting or changing the selection
Next

The sooner you quit selecting, the better your code is going to be.

--
Regards,
Tom Ogilvy


"aca" wrote in message
...

Thank you, Bob, for a quick reply.

Your line works all right. But I would like to avoid using Offset
because I want my ActiveCell to remain the same one (C4), as this line
is part of a search down column C which must go on, and it would take
longer if the Active cell hast to shift to column A at each find and
then back to C to continue the search.

Cannot I select A5:F5 while staying at C4 as my Active cell?

But, hanks again.
ACA


--
aca
------------------------------------------------------------------------
aca's Profile:

http://www.excelforum.com/member.php...o&userid=25933
View this thread: http://www.excelforum.com/showthread...hreadid=546246