hi.
I have the following VBA code. I need it to run automatically when a cell has changed.
I have put the code into the Sheet 1"Tipping" code section. But it doesn't do anything whatsoever. I am sure its a fundamental mistake on my behalf.
Thank you in advance.
Ged
I have the following VBA code. I need it to run automatically when a cell has changed.
VBA Code:
Sub SORT()
'
' SORT Macro
'
Range("AO1:AP10").Select
ActiveWorkbook.Worksheets("Tipping").SORT.SortFields.Clear
ActiveWorkbook.Worksheets("Tipping").SORT.SortFields.Add2 Key:=Range( _
"AP2:AP10"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Tipping").SORT.SortFields.Add2 Key:=Range( _
"AO2:AO10"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Tipping").SORT
.SetRange Range("AO1:AP10")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("AO15").Select
End Sub
I have put the code into the Sheet 1"Tipping" code section. But it doesn't do anything whatsoever. I am sure its a fundamental mistake on my behalf.
Thank you in advance.
Ged