Disable Sorting using VBA

  • I would like to be able to disable only sorting in tables in worksheet, but at the same time allow filtering.


    I have tried the following code, that I have found here in the website, but have not got it to work correctly, does any one see what I need to add or remove to get this to work.


    Lastly, I am newly using VBA.



    thank you!

    Ibrahim

    Edited once, last by Carim: Added Code Tags ().

  • Where have you copied the code to? It should be in the WorkBook Module, I suspect that you have not put it there.


    Read this for a full explanation


    Where to put your Excel VBA Code