Hi every body,

I am using a Command button to copy/past data from different sheets to an "Archive" spreadsheet in rows. the "Archive" spreadsheet columns start from "A" to "AV" ; with a header , so, the first row is "2" and the last row is "65000".
I need to insert the data row alphabetically based upon the first column "A" (Customer Last Name). I use this VB but unfortunately it does not work!

Thank you so much in advance

VB:

Dim IngWriteRow As Long
Dim ws1 As Worksheet
Set ws1 = Worksheets("Customer Records")
Dim ws2 As Worksheet
Set ws2 = Worksheets("Archive")
Dim ws3 As Worksheet
Set ws3 = Worksheets("Book History")
Dim ws4 As Worksheet
Set ws4 = Worksheets("Over Work")
Dim lngWriteRow As Long
lngWriteRow = ws2.Cells(65000, 1) _
.End(xlUp).Offset(1, 0).Row
If lngWriteRow < 2 Then lngWriteRow = 2

Range("A1:A65000").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll Down:=60
ActiveWindow.ScrollRow = 1
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal


ws2.Range("A" & lngWriteRow) = ws1.Range("C10").Value
ws2.Range("B" & lngWriteRow) = ws1.Range("G10").Value
ws2.Range("C" & lngWriteRow) = ws3.Range("A5").Value
ws2.Range("D" & lngWriteRow) = ws3.Range("I6").Value
.
.
ws2.Range("AV" & lngWriteRow) = ws4.Range("D16").Value

End Sub