ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting A Range (https://www.excelbanter.com/excel-programming/272294-selecting-range.html)

patrick molloy

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
.



All times are GMT +1. The time now is 01:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com