#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Sort Code

I created this macro that when executed will use a second sheet I created to
sort te contents in the cell I'm currently selecting. I would like to take
the process one step further and have this code loop until there there isn't
any more data to sort. Here are the specifics of the sheet. All of the data I
need to sort is in column E starting on row 2. The number of rows in the
sheet is not constant. It coulld be 50 rows or 3000 rows.

My next step will be to move the functions I have on the other workbook to
the same workbook as the data but on a different sheet.


Sub Sort()
Application.DisplayAlerts = False
'
' Sort Macro
' Macro recorded 12/27/2005
'

'
Windows("Code Report Tool.xls").Activate
Range("A1").Select
Application.CutCopyMode = False
Selection.ClearContents
Rows("3:3").Select
Selection.ClearContents
Windows("Bank XXX Code reports 12-23-05.xls").Activate
Selection.Copy
Windows("CODE Report Tool.xls").Activate
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Range("A3"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True,
Tab:=False, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5,
1), Array(6, 1), _
Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1),
Array(12, 1)), _
TrailingMinusNumbers:=True
Rows("3:3").Select
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal
Range("A19").Select
Selection.Copy
Range("A8").Select
Windows("Bank XXX CODE reports 12-23-05.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Application.DisplayAlerts = True
End Sub
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 zip code daniel Excel Discussion (Misc queries) 2 March 17th 09 11:05 PM
sort by code Jay Excel Discussion (Misc queries) 1 February 11th 08 01:09 PM
Code for Advanced Sort fugfug[_4_] Excel Programming 9 July 14th 05 02:40 PM
vba code to sort data? eadie Excel Programming 3 December 23rd 03 02:09 PM
Sort Code Modification Todd Huttenstine\(Remote\) Excel Programming 1 November 27th 03 08:18 AM


All times are GMT +1. The time now is 01:35 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"