help with autosort

T

thegr812k

Hi i wonder if anyone can help this might be really basic but i cant ge
my head around... what im trying to do is autosort a list of names whic
have a cell next to them with a value ie:

column a column b
bill 32
bob 27
john 98
dave 99999
chris 26

now each name has a corresponding number, i want to beable to sort b
name alphabetically but when this happen for the corresponding number t
move alongside with it, i have used this in VB:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("B:B"), Target) Is Nothing Then
Exit Sub
End If
Range("B:B").Sort Key1:=Range("B1"), Order1:=xlAscending
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub


which sorts alphabetically automatically fine but does not help wit
the problem of the linked cells, is there a simple solution to this?
have no idea how i can so this but im sure there is prob a simple way
any help would be greatly appreciated
 
K

ksal

Highlight all data and go to Data/Sort. You want to sort by column A and do
it ascending.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top