Forum Discussion
Sumit_Bhokare
Aug 24, 2023Brass Contributor
Column hide & to unhide column password is required
Tech Community, I need one help, I have a main template from which I'm going generate one customer copy. while generating customer copy I need to hide column B:G of each sheet in customer copy, ...
- Aug 24, 2023
Sub CreateCopy() Dim wsh As Worksheet Dim fil For Each wsh In Worksheets wsh.Range("B1:G1").EntireColumn.Hidden = True Next wsh fil = Application.GetSaveAsFilename( _ InitialFileName:="New Workbook", _ FileFilter:="Excel Macro-enabled Workbook (*.xlsm),*.xlsm", _ Title:="Create copy of workbook") If fil = False Then Beep Else ActiveWorkbook.SaveCopyAs fil End If For Each wsh In Worksheets wsh.Range("B1:G1").EntireColumn.Hidden = False Next wsh End Sub
SergeiBaklan
Aug 24, 2023Diamond Contributor
As a comment, all information into the hidden columns of the protected sheet could be available to users without password. For example, it's enough in any unprotected cell to enter =B1 and drag to the right and down.
Sumit_Bhokare
Aug 24, 2023Brass Contributor
SergeiBaklan Columns which I want to hide will not have any data. first we are clearing those columns and then we want to hide those columns as deletion of columns is not allowed.
- SergeiBaklanAug 24, 2023Diamond Contributor
Sumit_Bhokare , I see, thank you