View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1767_] Rick Rothstein \(MVP - VB\)[_1767_] is offline
external usenet poster
 
Posts: 1
Default Extending a range selection

I think this code also does what you want...

With Selection
.End(xlToLeft).Resize(2, .End(xlToRight).Column - ..End(xlToLeft).Column + 1).Copy
End With

Rick


"Mats Samson" wrote in message ...
Thanks FSt1,
well not exactly, I wanted to select 2 rows and copy them.
However, meanwhile I solved it:
Selection.End(xlToLeft).Range("A1:A2").Select
Range(Selection, Selection.End(xlToRight)).Copy

Thanks anyway
Mats

"FSt1" wrote:

hi
if i understand you correctly, you are somewhere in A column and want to
select 2 rows down and to the end of the data. Assuming you have a solid
block of data, try this....
Range(ActiveCell, ActiveCell.Offset(2, 0).End(xlToRight)).Select

regards
FSt1

"Mats Samson" wrote:

Id like to extend the range selection of the CURRENT row from A column to 2
(adjacent) rows until End(xlRight) and then copy the selection
I dont seem to get it right having selected 2 rows and trying to extend the
selection until End(xlRight). Can anybody help with the syntax, please?