Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With help from this group, I am using the following code to hide empty
columns in my spreadsheet. It works when my sheet is not protected, however, when I deploy this sheet for use by others it will need to be password-protected. What can I add to the code to unprotect the sheet prior to hiding the columns and then re-protect the sheet after the columns have been hidden? Will my password-protection be preserved? Please help... Sub Hide_EmptyColumns() 'To hide columns with no data in rows 10:82 Application.ScreenUpdating = False With Sheets("Box") Dim col As Range For Each col In .Range("C10:AF82").Columns col.EntireColumn.Hidden = _ Application.Sum(col) = 0 Next End With Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to protect/unprotect a sheet using a macro with password | Excel Discussion (Misc queries) | |||
Password - Protect, UnProtect | Excel Programming | |||
Protect/unprotect sheet with password with VBA? | Excel Programming | |||
VBA code - protect and unprotect a sheet | Excel Programming |