Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("B1:B1000")) Is Nothing Then
Application.EnableEvents = False
Target.Offset(0, -1) = Application.WorksheetFunction.Max(Range("A1:A1000")) + 1
Set Rng = Range("A2:B" & [B65000].End(xlUp).Row)
Rng.Sort key1:=[A1], Order1:=xlAscending, Header:=xlNo
Application.EnableEvents = True
End If
End Sub