Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Automatic sorting

I have a workbook with 2 worksheets in it. One labeled "2007" the
other "2007 Invoices". In the "2007" worksheet, there are three
columns, "Date", "Last Name,First Name", and "Description". They are
Column A, B, and C respectively. In the "2007 Invoices" worksheet
there is basically an identical set up in terms of column headers
(theres some extra columns, but they have no impact on the situation).
In "2007 Invoices" cells, I have formulas so that as data is added to
"2007", it shows up in "2007 Invoices" as well. The formula I have
carried out over 1100 rows so that I can be sure all entries will
carry over from "2007". The part I'm getting caught up on is creating
an automatic sorting macro for "2007 Invoices". So far I have:
Private Sub Worksheet_Activate()
Dim LRow As Long '-- SORT on Col A then B
'Find row before last row in Column B with content
LRow = Cells(Rows.Count, 1).End(xlDown).Offset(-1, 0).Row
Rows("5:" & LRow).Sort Key1:=Range("B5"), _
Order1:=xlAscending, Key2:=Range("A5"), _
Order2:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub

I want it sorted alphabetically, then chronologically within each name
listed. When I run the macro, the names entered are sorted properly,
but they show up at the bottom of my list. So if I have 5 entries,
they show up in cells 1096-1100. I'm not sure how to move the entries
to the top of my list (entries start in row 5 because I have heading
information in Rows 1-4). Any input would be appreciated. Thanks.

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
Automatic Sorting Blade370 Excel Discussion (Misc queries) 1 March 20th 07 12:20 PM
automatic sorting in excel Gostal New Users to Excel 2 December 26th 06 08:35 PM
Automatic sorting in excel Gostal Excel Discussion (Misc queries) 2 December 21st 06 06:54 PM
automatic sorting gmisi Excel Worksheet Functions 3 October 11th 06 11:33 PM
Automatic Sorting????? Bigredno8 Excel Discussion (Misc queries) 3 May 28th 05 11:11 PM


All times are GMT +1. The time now is 11:18 AM.

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"