View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
patrick molloy patrick molloy is offline
external usenet poster
 
Posts: 391
Default Selecting A Range

Dim rTable As Range
Dim WS As Worksheet
Set WS = ActiveSheet

Set rTable = WS.Cells.CurrentRegion

Now you have rTable in memory referencing the sheet
region. Don't forget that you can manipulate data easily
without necessarily having the sheet active nor the cells
selected. The code above works whatever sheet is active.

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
I am trying to write some code that will look at the
uppermost cell in a range of cells, and then select the
range of cells that belong to the same bunch of data
(i.e. all the way to the right of the initial cell until
the range ends, and all the way to the bottom of the
initial cell until the range ends). Any help would be
greatly appreciated. Thanks.

Jason
.