Hi,
I have multiple tables in a workshseet and i want each table to automatically sort based on latest 52 week sales numbers.
First table is located between F16:AO26 sort by desecnding order based on column AI
Second table is located F30:AO57 sort by desecnding order based on column AI
Third table is located F62:AO84 sort by desecnding order based on column AI
I use below code to sort one table at a time. How can i modify the code and so that i can automatically sort all tables at once? Thank you
I have multiple tables in a workshseet and i want each table to automatically sort based on latest 52 week sales numbers.
First table is located between F16:AO26 sort by desecnding order based on column AI
Second table is located F30:AO57 sort by desecnding order based on column AI
Third table is located F62:AO84 sort by desecnding order based on column AI
I use below code to sort one table at a time. How can i modify the code and so that i can automatically sort all tables at once? Thank you
Code:
PrivateSub Worksheet_Change(ByVal Target As Range)'turn off updates to speed up code executionWith Application
.ScreenUpdating =False.EnableEvents =False.Calculation = xlCalculationManual.DisplayAlerts =FalseEndWith
IfNot Intersect(Target, Columns(1))IsNothingThen
With ActiveSheet.Sort.SetRange Range("f16:ao26"& Cells(Rows.Count,1).End(xlUp).Row).Header = xlYes.MatchCase =False.Orientation = xlTopToBottom.SortMethod = xlPinYin.ApplyEndWith
EndIf
With Application.ScreenUpdating =True.EnableEvents =True.Calculation = xlCalculationAutomatic.DisplayAlerts =TrueEndWith
EndSub