Hi all, I have a protected and shared worksheet with Autofilter set to on. My problem is that various users save their work with their own filters set. I unshared the worksheet and unprotected it, added a button that would reset the filters to show all data, reprotected it and shared it again – once I did that I got a message about the macro not being available and could not click on the macro button. Is there a way I can have the filters reset on opening the file?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Macros on Shared & Protected worksheet (Excel 2003)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Macros on Shared & Protected worksheet (Excel 2003)
- This topic has 6 replies, 3 voices, and was last updated 16 years, 3 months ago.
Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody LoungerFebruary 7, 2009 at 9:48 am #1146131Welcome to Woody’s Lounge!
Unshare the workbook.
Activate the Visual Basic Editor.
Double-click the ThisWorkbook item in the Project Explorer tree on the left hand size.
Enter or copy/paste the following code into it:
Private Sub Workbook_Open()
With ActiveSheet
If .FilterMode = True Then
.ShowAllData
End If
End With
End Sub
If the workbook has multiple sheets and you want to reset the filter in a specific sheet, replace ActiveSheet with Worksheets(“NameOfSheet”).If the workbook has several sheets that have their own filter, you can loop through the sheets:
Private Sub Workbook_Open()
Dim wsh As Worksheet
For Each wsh In Me.Worksheets
If wsh.FilterMode Then
wsh.ShowAllData
End If
Next wsh
End Sub
Remember, this code belongs in the ThisWorkbook module, not in a ‘standard’ module where normal macros are stored. -
WSsimmo7
AskWoody Lounger
-
WSpieterse
AskWoody LoungerFebruary 7, 2009 at 5:29 pm #1146154Hi Maria,
I’d like to take the opportunity to warn you against sharing workbooks.
Excel is not a multi-user application and sharing workbooks has a bad reputation of loss of data, corruption of files and loss of changes to the data.I strongly advise you to start looking for a different solution, like a database.
-
WSsimmo7
AskWoody LoungerFebruary 8, 2009 at 2:07 am #1146202Jan, There is no need to go to a database as the file in question is only used for one week, a new file is created in the following week with any comments carried forward into a new week for old data and new data being brought in for users to comment on. As the data is so short lived, and can be recreated very easily then loss of data or data corruption is less of a concern.
-
WSpieterse
AskWoody Lounger -
WSsimmo7
AskWoody LoungerFebruary 14, 2009 at 2:21 am #1147248Jan,
Our Company standardizes its software, so there would never be a situation where there are different versions of Excel. Thanks for the info though, as there could be a situation where someone has a different version at home, and wanted to do some work on the file at home – shouldn’t happen though as we are supposed to use a Citrix interface to access our work files from home (using the same software as at the office).
Regards,
Maria
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Rufus is available from the MSFT Store
by
PL1
33 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
2 hours, 42 minutes ago -
KB5061768 update for Intel vPro processor
by
drmark
24 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
53 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
17 hours, 54 minutes ago -
Office gets current release
by
Susan Bradley
1 hour, 5 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
1 day, 15 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
23 hours, 40 minutes ago -
Stop the OneDrive defaults
by
CWBillow
1 day, 15 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
2 days, 1 hour ago -
X Suspends Encrypted DMs
by
Alex5723
2 days, 4 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
2 days, 4 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
2 days, 5 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
2 days, 5 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
1 day, 17 hours ago -
Enabling Secureboot
by
ITguy
2 days ago -
Windows hosting exposes additional bugs
by
Susan Bradley
2 days, 13 hours ago -
No more rounded corners??
by
CWBillow
2 days, 9 hours ago -
Android 15 and IPV6
by
Win7and10
1 day, 23 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
3 days, 1 hour ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
3 days, 4 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
2 days, 23 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
3 days, 11 hours ago -
May preview updates
by
Susan Bradley
2 days, 23 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
2 days, 14 hours ago -
Just got this pop-up page while browsing
by
Alex5723
3 days, 4 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
3 days, 1 hour ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
2 days, 3 hours ago -
At last – installation of 24H2
by
Botswana12
4 days, 3 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
1 hour, 21 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.