Clearing Autofilters on Protected Sheet

spareshoota

New Member
Joined
Jul 11, 2011
Messages
2
Hi,

I don't know where else to go, so I help someone can help. My level of expertise in Excel is very high, but not in VBA. I just started to learn VBA but have a long way to go.

I have a spreadsheet that is used by a group of people, one at a time. It is password protected and contains both locked & unlocked cells. My data range is A4:AC1299. While protected, I have the autofilters on, but most of the time, people are filtering on multiple columns. Since it's protected, they aren't able to just hit "clear" to return to all lines of the table.

I want them to be able to hit a button that runs a macro that clears all the filters but leaves the arrows so that they can refilter if necessary. I've tried 5-6 different macros I've found on the Internet, but all of them either don't work or produce a runtime error '1004' or some other sort of error.

Anybody that can come up with a macro that does this would be greatly appreciated. Unfortunately, I can't put up the spreadsheet because it's for work. Thanks.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Here is the main one I tried that continues to give me errors:


Sub ShowAllRecords() If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData End If End Sub

It generates the error "Run-time error '1004': ShowAllData method of Worksheet class failed" and then highlights
ActiveSheet.ShowAllData </pre>
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,233
Members
452,898
Latest member
Capolavoro009

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