Protect a tab but retain collapse/expand column functionality

LonnyR

New Member
Joined
Sep 24, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hello Excel gurus - Is there a way I can password protect a tab but still retain expand/collapse functionality? I need to be able to prevent users from deleting cells, columns, rows, and protect formatting and formulas but need to allow users to be able to expand and collapse columns.

1600962584683.png
 

Attachments

  • 1600962574570.png
    1600962574570.png
    1.7 KB · Views: 1

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
8,253
Office Version
  1. 2016
Platform
  1. Windows
Add this code in the ThisWorkbook Module:

VBA Code:
Private Sub Workbook_Open()

    With Sheet1   '<= change name as required.
        .Protect UserInterfaceOnly:=True
        .EnableOutlining = True
    End With

End Sub
 

LonnyR

New Member
Joined
Sep 24, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Add this code in the ThisWorkbook Module:

VBA Code:
Private Sub Workbook_Open()

    With Sheet1   '<= change name as required.
        .Protect UserInterfaceOnly:=True
        .EnableOutlining = True
    End With

End Sub
Thank you!
 

Forum statistics

Threads
1,136,909
Messages
5,678,516
Members
419,768
Latest member
eguechi09x

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
Top