![]() The full sub is copied below, the variables are declared elsewhere, and again, this works fine on a PC so it shouldn't be anything like a non-declared variable issue. ![]() How can I modify the code so that it works on both PC and mac? How do I go about troubleshooting, given I don't get any error messages? So the problem is clearly with the Range.Sort I have created a new excel document, added some random numbers into column A, and created a button that calls Range("A1:A8").Sort key1:=Range("A1") and the results are the same - instant crash. It just doesn't seem to like the Sort function. RngAllData is a valid range, and if I change the line of code to simply rngAllData.Select it selects the range I'm expecting to sort, no problems. ![]() RngAllData.Sort key1:=Cells(3, colNum), order1:=xlDescending ![]() The line of code that causes the crash is: generate an error messsagebox, it won't even do that - as soon as it encounters this line of code, excel is gone. Even if I use On Error GoTo Something so I can e.g. It doesn't throw a VBA error - it just flat out shuts down excel. The mac is running Big Sur, v11.3.Īll of the more complicated code works just fine, but a simple sort function causes excel to crash. I'm now testing it on a Mac with Office 365 for Mac installed. I have an excel spreadsheet with a lot of VBA behind it.
0 Comments
Leave a Reply. |