ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Relative Ranges - Multiple Cells (https://www.excelbanter.com/excel-programming/366950-relative-ranges-multiple-cells.html)

helen

Relative Ranges - Multiple Cells
 
I would like to select a range of cells from column A - column L, but
everytime I run the loop the starting row reference and the number of rows
will be different.

I've worked out a solution, but it will only work if I can get a relative
range to select multiple cells... something like this:

Range("A" & myMarks(k)).Activate
ActiveCell.Offset(0,0:Group, 11).Select

But it doesn't work... is there anything that will do the same job?





Tom Ogilvy

Relative Ranges - Multiple Cells
 
Range("A" & myMarks(k)).Activate
ActiveCell.Resize(Group, 11).Select

assuming that group is the number of rows you want to select

or

Cells(MyMarks(k),"A").Resize(group,11).Select

--
Regards,
Tom Ogilvy


"Helen" wrote:

I would like to select a range of cells from column A - column L, but
everytime I run the loop the starting row reference and the number of rows
will be different.

I've worked out a solution, but it will only work if I can get a relative
range to select multiple cells... something like this:

Range("A" & myMarks(k)).Activate
ActiveCell.Offset(0,0:Group, 11).Select

But it doesn't work... is there anything that will do the same job?






All times are GMT +1. The time now is 07:20 PM.

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