ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting a range of cells , how to ? (https://www.excelbanter.com/excel-programming/383848-selecting-range-cells-how.html)

Luc

Selecting a range of cells , how to ?
 
Hello,

I have a problem with selecting cells.

The selection allways goes from column A to M.
The number of rows starts allways from A 11, to the LAST CELL in column A
which contains a number
So the column range is fix, and the row range is variable.

For example :
It can be A11 to M24
or A11 to M5
or A11 to M11 (this is only 1 row)

What code should i use in the macro ?

Thanxx

Luc


--------------------------------------------------------------------------------
Mijn Postvak In wordt beschermd door SPAMfighter
301 spam-mails zijn er tot op heden geblokkeerd.
Download de gratis SPAMfighter vandaag nog!



Gary''s Student

Selecting a range of cells , how to ?
 
Sub ordinate()
n = Cells(Rows.Count, "A").End(xlUp).Row
Set r = Range(Cells(11, "A"), Cells(n, "M"))
r.Select
End Sub

--
Gary''s Student
gsnu200707


"Luc" wrote:

Hello,

I have a problem with selecting cells.

The selection allways goes from column A to M.
The number of rows starts allways from A 11, to the LAST CELL in column A
which contains a number
So the column range is fix, and the row range is variable.

For example :
It can be A11 to M24
or A11 to M5
or A11 to M11 (this is only 1 row)

What code should i use in the macro ?

Thanxx

Luc


--------------------------------------------------------------------------------
Mijn Postvak In wordt beschermd door SPAMfighter
301 spam-mails zijn er tot op heden geblokkeerd.
Download de gratis SPAMfighter vandaag nog!





All times are GMT +1. The time now is 02:12 PM.

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