Protect sort

CHSLax60

New Member
Joined
Jun 6, 2011
Messages
15
Here is my scenario. I have multiple people who need to enter and edit data in a worksheet. However, instead of just filtering to find what they need, people are sorting to find the things they need to edit BUT they aren't including all of the colunms when they sort. This is corrupting the data.

Protecting cells isn't the issue; besides they need to have the ability to edit all of the cells and save their changes. I basically need to protect the function. Is there a way to NOT allow people to resort the file but still allow them to filter it?

A second option would be that I can turn on the filter then if I could just hide the entire ribbon that would work as well.
 
Wow! I didn't know that. In testing this, I found that using the "autosort" buttons do show the warning if a less-than-complete range is selected. However using the big Sort button does not give this warning. That's just plain incomprehensible.
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Now as for the first solution. Am I to take your comment after the first one to mean that this will disable the ribbon on the users computer even after this workbook is no longer active? If so, that would be a deal breaker. Is this true for the second one as well or is that one affecting the users application only while this workbook is open.

If you were to put the code in the workbook's ACTIVATE/DEACTIVATE event handlers then it would only happen when the user activated the workbook in question. Do note that this would still leave SORT available on the popup right-click menu.

What about just hiding or disabling only the "sort filter" button?
Possible, but much easier said than done.
 
Upvote 0
If you were to put the code in the workbook's ACTIVATE/DEACTIVATE event handlers then it would only happen when the user activated the workbook in question.

Now a little page thumbing tells me that I can even do this down to the worksheet level using "worksheet_Activate()", is that true?

Being fairly new to this marco/vb side of excel, I'm not exactly sure how to construct it so any help you could give me to shorten the trial & error process so I can get my weekend started would be greatly appreciated.:)
 
Upvote 0
Right-click the tab for sheet in question and you'll see a popup where one of the options is View Code. Click that. You'll hop in to the VBE and at the top of the code pane you'll see (General) on the left and (Declarations) on the right.

Click the left dropdown and pick Worksheet. The right will automatically change to SelectionChange. Click the right dropdown to Activate and drop Peter's code into the code stub. Then change the right side to Deactivate and put the code again inside the stub, chaning the FALSE to a TRUE.

Clean up (delete) the stub that was created for Worksheet_SelectionChange.
 
Last edited:
Upvote 0
Right-click the tab for sheet in question and you'll see a popup where one of the options is View Code. Click that. You'll hop in to the VBE and at the top of the code pane you'll see (General) on the left and (Declarations) on the right.

click the left dropdown and pick Worksheet. The right will automatically change to SelectionChange. Click the right dropdown to Activate and drop Peter's code into the code stub. Then change the right side to Deactivate and put the code again inside the stub, chaning the FALSE to a TRUE.

Clean up (delete) the stub that was created for Worksheet_SelectionChange.

Thank you sir. You are a gentleman and a scholar… and worthy of the silent toast preceding that first draw of a cold Shiner Bock in my very near future.
 
Upvote 0

Forum statistics

Threads
1,224,579
Messages
6,179,656
Members
452,934
Latest member
mm1t1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top