ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   best way to get reference to all used cells (https://www.excelbanter.com/excel-worksheet-functions/55017-best-way-get-reference-all-used-cells.html)

sugargenius

best way to get reference to all used cells
 
I was using the macro recorder to see how to use the range.sort
function. When I did, I got something like:

Range("A1:J235").Sort Key1:=Range("A1"), Order1:=xlAscending

I should always know the number of columns but the number of rows will
vary. What's the best in code of coming up the "A1:J235"?

Thanks,
Woody


sugargenius

best way to get reference to all used cells
 
ignore..wrong group.
woody



All times are GMT +1. The time now is 03:21 PM.

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