unknown range

F

fanny

I want to write a macro that selects a range that starts in A3 and ends in
Jsomewhere. Is it possible to refer to an unknown cell in an known column?
 
D

Don Guillett

It might be nice to know what determines the "unknown" cell.
=offset($a$3,0,0,counta($J:$J),10)
could be a defined name range to find the last cell in J based on data in J
 
G

Gord Dibben

fanny

This macro will select the range from A3 to the last entry in coloumn J whicj I
assume would be the "unknown cell".

Any other "unknown cell" in J would need nore explanation from you.

Sub Select_Test()
Dim topCel As Range
Dim bottomCel As Range
Set topCel = Range("A3")
Set bottomCel = Cells(Rows.Count, 10).End(xlUp)
Range(topCel, bottomCel).Select
End Sub


Gord Dibben MS Excel MVP
 
G

Gord Dibben

I just have to start using the chell-specker

"whicj" and "nore" could use a little work<g>

No typos in the code, however.


Gord
 
Top