(Solved) – Macro to sort table not working on older Excel version

(solved)-–-macro-to-sort-table-not-working-on-older-excel-version

Friends, I’m experiencing a VBA issue with macros not running on a different computer. I suspect that this is due to a version difference – I am using 365 Pro.

I have a button, which, upon clicking, runs a macro that calls “UpdateMD()” Sub, which is supposed to sort a table. This always works fine. On my colleague’s computer, at this point the debugger shows up, jumping to the UpdateMD module. Please take a look and suggest what could be the issue with an older version of excel on my colleague’s laptop?

Sub UpdateMD()
'
' UpdateMD Macro
'
    ActiveWorkbook.Worksheets("Manual data").ListObjects("Table1").Sort.SortFields. _
        Clear
    ActiveWorkbook.Worksheets("Manual data").ListObjects("Table1").Sort.SortFields. _
        Add2 key:=Range("Table1[[#All],[Dev ID]]"), SortOn:=xlSortOnValues, Order _
        :=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Manual data").ListObjects("Table1").Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *