I am currently using the following code to sort data in a spreadsheet. Numbers appear in these cells if certain criteria is met in the spreadsheet (i.e. 1 for E1, 2 for E2, and nothing if the criteria is met).
Worksheets("Sheet1").Range("E1:E11").Sort _
Key1:=Worksheets("Sheet1").Range("E1")
This data is always being sorted using code from Userforms to determine what data needs to be incorporated in other userforms. The code works fine until I protect the sheet. For some reason it locks cells E1 to E11. I have tried to unlock the cells via code before and after the sorting, but it still is unable to sort. Any ideas?
Worksheets("Sheet1").Range("E1:E11").Sort _
Key1:=Worksheets("Sheet1").Range("E1")
This data is always being sorted using code from Userforms to determine what data needs to be incorporated in other userforms. The code works fine until I protect the sheet. For some reason it locks cells E1 to E11. I have tried to unlock the cells via code before and after the sorting, but it still is unable to sort. Any ideas?