Hello everybody,

I use a Macro to add a row alphabetically in a spreadsheet (Archive) , based-on the name in the range ("F"). It is working well, however there are tow problems:
1- the row is inserted alphabetically in tow steps. First, it inserts the row in the last empty row , then inserts it alphabetically when the next row is inserted.
2- this macro works only through a command button in the same spreadsheet.

What I want to do: 1- To insert the row alphabetically in one step only.
2- I want to use this macro through a command button in another worksheet (Store).




PHP Code: 
Private Sub cmdbArchiveInsert_Click()
Dim lngWriteRow As Long
Dim ws2 
As Worksheet
Set ws2 
Worksheets("Archive")
lngWriteRow ws2.Cells(650001_
.End(xlUp).Offset(10).Row
If lngWriteRow 2 Then lngWriteRow 2
 
 Range
("A1:A65000").Select
 Range
(SelectionSelection.End(xlDown)).Select
 Range
(SelectionSelection.End(xlDown)).Select
 ActiveWindow
.SmallScroll Down:=60
 ActiveWindow
.ScrollRow 1
 Selection
.Sort Key1:=Range("A2"), Order1:=xlAscendingHeader:=xlGuess_
 OrderCustom
:=1MatchCase:=FalseOrientation:=xlTopToBottom_
 DataOption1
:=xlSortNormal

    ws2
.Range("A" lngWriteRow) = TxtLastName.Value
    ws2
.Range("B" lngWriteRow) = txtbFirstName.Value
     ws2
.Range("C" lngWriteRow) = TxtToday.Value
    ws2
.Range("D" lngWriteRow) = TxtStore[PHP
.Value
ws2.Range("E" & lngWriteRow) = TxtPayer.Value
ws2.Range("F" & lngWriteRow) = TxtFullName.Value
ws2.Range("G" & lngWriteRow) = TxtJob.Value[/PHP]


Thank you so much in advance

Kiko