Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I export a query from Access on which I have to perform statistical analysis. The data always start at cell A2, but can stop at whatever cell in the A range. E.g. it could be A345 or A21. How can I, programmatically, position myself on A2 and then select from A2 till the last "filled" cell, e.g. A345 ? Thank you, W |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub dural()
n = Cells(Rows.Count, "A").End(xlUp).Row Range("A2:A" & n).Select End Sub -- Gary''s Student - gsnu200808 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you, this works fine.
W |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And, in case you don't know, Gary's code can be made into one single line:
Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row).Select And in case, you want to make sure that selection isn't done 'backward', if no cell with data is found in column A: Range("A2:A" & WorksheetFunction.Max(2, Cells(Rows.Count, "A").End(xlUp).Row)).Select Sorry, Gary :-) CE -- Gary''s Student - gsnu200808 Gary''s Student wrote: Sub dural() n = Cells(Rows.Count, "A").End(xlUp).Row Range("A2:A" & n).Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Goto last cell | Excel Programming | |||
Goto Data validation Same ERROR | Excel Discussion (Misc queries) | |||
Validation Data & Goto question | Excel Discussion (Misc queries) | |||
Goto end of data & select all rows below | Excel Programming | |||
goto a particular cell | Excel Programming |