ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Match and Sort in a Macro (https://www.excelbanter.com/excel-discussion-misc-queries/101029-match-sort-macro.html)

Si

Match and Sort in a Macro
 
Hi All,
Thanks in advance for any Help.

I have a macro which opens a .csv file and places into Excel.
A2:AH19
colum B2 contains a number which is sorted lowest to highest
each row contains relevant information to that number
In colum AL I have the correct order for colum and row B2 coming from
another sheet
After Import of the .csv I want to sort all rows to match colum AL order.
Please Help got me stumped.
I am using MS Excel 2003
Here's my Macro so far

Sub Import()
'
' Import Macro
' Macro recorded 18/06/2006 by Si
'

'
Application.ScreenUpdating = False
ChDir "C:\CSV Files"
Workbooks.Open Filename:=Application.GetOpenFilename("Text Files, *.csv")
Range("A1:AH19").Select
Selection.Copy
Windows("Excel Workbook.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Selection.Copy
Sheets("Sheet2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Sheets("Sheet1").Select
Application.CutCopyMode = False
Range("A1").Select
Application.ScreenUpdating = False
End Sub

Yes .csv file is copied to another sheet want it sorted before copy to other
sheet.


All times are GMT +1. The time now is 08:36 AM.

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