Sort and filter on a protected sheet

Oryon

New Member
Joined
May 21, 2022
Messages
9
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
  8. 2007
  9. 2003 or older
  10. Prefer Not To Say
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Hello,

I am working on an Excel spreadsheet where I would like it to be possible to sort while the sheet is protected, as it contains formulas and will be used by multiple users. So far, I have only managed to add a macro that allows filtering and clearing filters, but I would also like sorting to be possible.

Could you help me, please?

TEST Sort and Filter.xlsm
ABCD
1
2
3
4
5
6
7NAMENUMBEREXIT DATEMAX. EXIT DATE
83222405/02/202419/02/2024
904/01/202418/01/2024
1015/02/202429/02/2024
11PEDRO56895609/02/202423/02/2024
12MARIA 23541426/01/202409/02/2024
13ANA78541226/01/202409/02/2024
14JUAN54585609/02/202423/02/2024
Hoja1
Cell Formulas
RangeFormula
D8:D14D8=IF(C8="","",WORKDAY.INTL(C8,10,1,))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D8:D14Cellcontains a blank value textNO
D8:D14Expression=Y($D8<=HOY()+5;$D8>HOY())textNO
D8:D14Expression=$D8>HOY()+5textNO
D8:D14Expression=$D8<=HOY()textNO
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
At the start of the code put
VBA Code:
activesheet.unprotect
at the end of the code
VBA Code:
activesheet.protect
you should then be able to put a sort line within the code.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Sort and filter on a protected sheet
+ Other places. Please provide links to all the places that you have asked this question.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Sort and filter on a protected sheet
+ Other places. Please provide links to all the places that you have asked this question.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
I apologize a thousand times for what happened. I've been dealing with this for several days and can't find the solution. My knowledge in VBA is very limited, which is why yesterday I decided to post it in multiple forums at once. I'm truly sorry. My most sincere apologies. I`m really sorry.

This are the other post where I ask, but whitout solution:

Excelforum
forums.excelguru.
msofficeforums
 
Upvote 0
This are the other post where I ask, but whitout solution:

Excelforum
forums.excelguru.
msofficeforums
Thanks for this, but could you please post links to your threads there? (No real need for Excel Forum though since I posted the link above)
It would be reasonable for anybody considering helping here to be able to visit those other forums if they want to see if any suggestions have already been made, or question resolved.
 
Upvote 0
Finally I did more or less what I was searching for. Maybe is not the best way to do it, but i hope it could help me. Thank you for your patient.
As I can upload here the Excel, I put another web where is it, in case you need o you could improve.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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