Hello i have a members list with with cell be containing members name (starting in B3) in the following format (lastname, firstname) then in Column C i have the members location. i have made a VBA that sorts the lists but it doesnt keep the members location and name together!
i want it to auto soft the names alphabetically but keep their location beside it in column C
Private Sub Worksheet_Change(ByVal Target As Range)
Dim x As Range
Set x = Cells(2, Target.Column)
Dim y As Range
Set y = Cells(1000, Target.Column)

If Target.Column = 1 Or Target.Column = 2 Or Target.Column = 3 Then
Range(x, y).Sort Key1:=Target, Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End If
End Sub
this is the code i am using, Can anyone tell me where i have gone wrong?
regards
Anthony