Is there a way to re-sort automatically? I have automatically updating cells and depending on incoming values the rankings change. I am looking for a way to have the table resort automatically (similar to conditional formatting) without having to click the re-sort button.
The goal here is to accomplish such purely through a built-in Excel2013 function. I am not looking for a solution that involves additional cells that aide the sort, such as Rank(),...
I include the code of a macro that refreshes the workbook at set interval and also included code within one worksheet that is supposed to refresh the tables on that one sheet on Worksheet_Calculate. I am getting a runtime error not sure what is wrong?
Public RunWhen As Double Const frequency = 5 Const cRunWhat = "DoIt" ' the name of the procedure to run Sub StartTimer() RunWhen = Now + TimeSerial(0, 0, frequency) Application.OnTime RunWhen, cRunWhat, Schedule:=True End Sub Sub DoIt() Sheets("RAWDATA").Calculate ActiveSheet.Calculate StartTimer ' Reschedule the procedure End Sub Sub StopTimer() On Error Resume Next Application.OnTime RunWhen, cRunWhat, Schedule:=False End Sub
and the code that supposedly refreshes the tables
Private Sub Worksheet_Calculate() With Application .ScreenUpdating = False .EnableEvents = False .DisplayAlerts = False End With ActiveSheet.ListObjects("Table2").AutoFilter.ApplyFilter With ActiveWorkbook.Worksheets("Strategies").ListObjects("Table2").Sort .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With ActiveSheet.ListObjects("Table3").AutoFilter.ApplyFilter With ActiveWorkbook.Worksheets("Strategies").ListObjects("Table3").Sort .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With With Application .ScreenUpdating = True .EnableEvents = True .DisplayAlerts = True End With End Sub