PDA

View Full Version : VBA that allows sorting of data by user



greyangel
09-27-2017, 12:45 PM
I am trying to figure out a macro that will allow users to sort data in ascending or descending order. I have tried the AllowSorting:=True, however that does not seem to work. I do have filters turned on automatically in the spreadsheet. Here is my current code below.



ws.Protect Password:="Random", UserinterfaceOnly:=True, DrawingObjects:=True, Contents:=True, Scenarios:=True, _
AllowSorting:=True, AllowFiltering:=True

Bob Phillips
09-27-2017, 01:59 PM
The cells in question must be unlocked.

greyangel
09-28-2017, 05:17 AM
What about a macro that allows sorting in the background for example the macro senses that the user wants to sort the data in ascending or descending order so it does it through the macro itself. With my current coding macros will work on all sheets.