Add A Row And Insert A Name Alphabetically In A Range
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(65000, 1) _
.End(xlUp).Offset(1, 0).Row
If lngWriteRow < 2 Then lngWriteRow = 2
Bookmarks