unknown range

  • Thread starter Thread starter fanny
  • Start date Start date
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?
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top