Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
Select Active Cells Umbu Excel Worksheet Functions 0 June 24th 08 02:03 PM
How to set printer default to select active sheet not whole book Vic Storey Excel Discussion (Misc queries) 0 May 16th 08 06:11 PM
How to select the active sheet? Eric Excel Worksheet Functions 1 August 7th 07 03:40 PM
How do you select two cells in different rows and columns with ou. M.G Excel Discussion (Misc queries) 3 December 17th 04 11:39 PM


All times are GMT +1. The time now is 12:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"