ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How select active rows from A to D columns? (https://www.excelbanter.com/excel-discussion-misc-queries/204692-how-select-active-rows-d-columns.html)

ldiaz

How select active rows from A to D columns?
 
I have a spread sheet like this, I want to make a macro to sort by Column A,
the problem is that the macro is written with an specific row:
Range("A1:D8").Select

How can I change the code to select active rows from column A to D?
and then apply the sort by column A, remember that rows may change from 8 to
20 or 1000.
A B C D
1 Part Desc Qty LOC
2 A15245 Etc 15 502A
3 B15245 Etc 15 503A
4 A15245 Etc 15 502A
5 C15245 Etc 15 501A
6 D15245 Etc 15 502B
7 A15245 Etc 15 502B
8 515245 Etc 15 502A

Thanks in advanced.
--
Lorenzo DÃ*az
Cad Technician

Barb Reinhardt

How select active rows from A to D columns?
 
Have you tried something like

Range("A1").CurrentRegion.Select
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"ldiaz" wrote:

I have a spread sheet like this, I want to make a macro to sort by Column A,
the problem is that the macro is written with an specific row:
Range("A1:D8").Select

How can I change the code to select active rows from column A to D?
and then apply the sort by column A, remember that rows may change from 8 to
20 or 1000.
A B C D
1 Part Desc Qty LOC
2 A15245 Etc 15 502A
3 B15245 Etc 15 503A
4 A15245 Etc 15 502A
5 C15245 Etc 15 501A
6 D15245 Etc 15 502B
7 A15245 Etc 15 502B
8 515245 Etc 15 502A

Thanks in advanced.
--
Lorenzo DÃ*az
Cad Technician


ldiaz

How select active rows from A to D columns?
 
This works great.
Thanks

LD
--
Lorenzo DÃ*az
Cad Technician


"Barb Reinhardt" wrote:

Have you tried something like

Range("A1").CurrentRegion.Select
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"ldiaz" wrote:

I have a spread sheet like this, I want to make a macro to sort by Column A,
the problem is that the macro is written with an specific row:
Range("A1:D8").Select

How can I change the code to select active rows from column A to D?
and then apply the sort by column A, remember that rows may change from 8 to
20 or 1000.
A B C D
1 Part Desc Qty LOC
2 A15245 Etc 15 502A
3 B15245 Etc 15 503A
4 A15245 Etc 15 502A
5 C15245 Etc 15 501A
6 D15245 Etc 15 502B
7 A15245 Etc 15 502B
8 515245 Etc 15 502A

Thanks in advanced.
--
Lorenzo DÃ*az
Cad Technician



All times are GMT +1. The time now is 04:15 PM.

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