Hello all. Below is a VBA macro code I recorded (manually sorting data in range A2:F29 based on the largest to smallest in range F2:F29). I would be most grateful if someone could amend it so that this is done automatically by excel (sort out the data) every say 5 secs. Many thanks
Code:
Sub AutoSort()'
' AutoSort Macro
'
' Keyboard Shortcut: Ctrl+p
'
Range("A2:F29").Select
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet2").Sort.SortFields.Add2 Key:=Range("F2:F29") _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet2").Sort
.SetRange Range("A2:F29")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("G3").Select
End Sub