Macro to hide/unhide columns in multiple worksheets and protect/hide on close

nfs001

New Member
Joined
Jan 24, 2018
Messages
3
Hello

I have limited knowledge with macros so would appreciate any advice you can give me.

I have a Workbook that has several users - most only need to view the Workbook, others need to edit certain columns. I would the columns that need to be edited hidden on opening and only visible once you have unprotected/unhidden them. I don't want anyone to just be able to open the Workbook and unhide the columns, so I'm guessing I need to password protect the Worksheets?

I have 4 Worksheets in the Workbook that contain identical data on each sheet (worksheets are called "2018", "2017", "2016" and "2015"). I would like columns I and L to be hidden on all sheets when the spreadsheet is opened and only unhidden when they need to be edited by certain users. I don't mind if columns I and L are unhidden on all 4 Worksheets at once.

I'm also slightly concerned that a User could accidentally save the Workbook without re-hiding the columns after they have made their changes so I'm not sure if there is a way to hide/protect the document automatically on close/save?

Hope this makes sense.

Thanks!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,136,258
Messages
5,674,678
Members
419,520
Latest member
Jennifer4Dillon

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