Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Sort on 3 columns when number of rows vary daily

I daily download data to an XL2007 workbook. The data has 30 columns. It needs to be sorted, and I use Data, Sort to sort by 1. Date, Values, A to Z, 2. Then by Type, Values, Z to A, and 3. Then by Area, Values, Smallest to Largest. This works fine. I would like to have a macro that performs this sort. Problem is, the number of rows vary daily from from a few dozen to a few hundred. How can i accomplish this sort on data that changes daily? The header info is always in row 1, and the data starts in row 2. Please note, the data imported is not appended to existing data, each day is a new worksheet called DataImp. So the data imported will always start at row 2.

Thanks,

Tonso
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Sort on 3 columns when number of rows vary daily

Hi Tonso,

Am Mon, 14 Jan 2013 05:17:51 -0800 (PST) schrieb Tonso:

I daily download data to an XL2007 workbook. The data has 30 columns. It needs to be sorted, and I use Data, Sort to sort by 1. Date, Values, A to Z, 2. Then by Type, Values, Z to A, and 3. Then by Area, Values, Smallest to Largest. This works fine. I would like to have a macro that performs this sort. Problem is, the number of rows vary daily from from a few dozen to a few hundred. How can i accomplish this sort on data that changes daily? The header info is always in row 1, and the data starts in row 2. Please note, the data imported is not appended to existing data, each day is a new worksheet called DataImp. So the data imported will always start at row 2.


calculate your last cell and use it with sort:

Dim LRow As Long

LRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("A1:AD" & LRow).Sort.............


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
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
Sort by color: Is there an easy way to sort columns or rows in EX MGP Excel Worksheet Functions 5 August 16th 08 11:28 AM
Using a macro to delete last 4 rows and last 2 columns which vary Shirley Munro Excel Programming 3 September 1st 05 04:56 PM
sorting rows wich can vary in number Bart Excel Discussion (Misc queries) 4 December 14th 04 06:59 AM
subtotalling - # of columns vary MDC Excel Programming 1 July 22nd 03 04:43 PM
subtotalling where # of columns vary MC[_2_] Excel Programming 1 July 21st 03 04:17 AM


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

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

About Us

"It's about Microsoft Excel"