How to Protect Hidden Columns in Excel – 4 Methods

Method 1 – Using the Format Cells Command to Protect Hidden Columns

This is the sample dataset.

Using Format Cells Option to Protect Hidden Columns in Excel

To hide columns:

Steps:

  • Select column D.
  • Press and hold Ctrl and select column G.

Using Format Cells Option to Protect Hidden Columns in Excel

  • Right-click the selected columns.
  • In the context menu, select Hide.

Columns D and G are not displayed.

Using Format Cells Option to Protect Hidden Columns in Excel

To protect the hidden columns:

  • Select the whole sheet, right-click and select Format Cells.

Using Format Cells Option to Protect Hidden Columns in Excel

  • In the Format Cells dialog box, select Protection.
  • Check Locked.
  • Click OK.

  • Place the cursor on the active sheet name, right-click and select Protect Sheet.

Using Format Cells Option to Protect Hidden Columns in Excel

  • In the Protect Sheet dialog box, enter a the password.
  • Click OK.

  • To confirm, enter the password again and click OK.

Using Format Cells Option to Protect Hidden Columns in Excel

The hidden columns are protected.

Using Format Cells Option to Protect Hidden Columns in Excel


Method 2 – Using the Go To Special Command to Protect Hidden Columns in Excel

Steps:

  • Select column D.
  • Press and hold Ctrl and select column G.

Applying Go To Special Command to Protect Hidden Columns

  • Right-click the selected columns.
  • In the context menu, select Hide.

Columns D and G are not displayed.

To Protect the hidden columns:

  • Go to the Home tab, select Editing.
  • Choose Find & Select.
  • Select Go To Special.

Applying Go To Special Command to Protect Hidden Columns

  • Select Formulas and click OK.

  • Place the cursor on the active sheet name, right-click and select Protect Sheet.

Applying Go To Special Command to Protect Hidden Columns

  • In the Protect Sheet dialog box, enter a the password.
  • Click OK.

Applying Go To Special Command to Protect Hidden Columns

  • Enter the password again and click OK.

The hidden columns are protected.

Applying Go To Special Command to Protect Hidden Columns


Method 3 – Using the Info Option to Protect Hidden Columns

Steps:

  • Select column D.
  • Press and hold Ctrl and select column G.

Using Info Option to Protect Hidden Columns

  • Right-click the selected columns.
  • In the context menu, select Hide.

Columns D and G are not displayed.

To protect the hidden columns:

  • Go to the File tab.

Using Info Option to Protect Hidden Columns

  • Select Info, and choose Protect Workbook.
  • Select Protect Current Sheet.

Using Info Option to Protect Hidden Columns

  • In the Protect Sheet dialog box, enter a password.
  • Click OK.

Using Info Option to Protect Hidden Columns

  • Enter the password again and click OK.

The hidden columns are protected.

Using Info Option to Protect Hidden Columns

Read More: How to Protect Columns with Password in Excel


Method 4 – Embedding a VBA Code to Protect Hidden Columns

 Steps:

  • Select column D.
  • Press and hold Ctrl and select column G.

Embedding VBA Code to Protect Hidden Columns

  • Right-click the selected columns.
  • In the context menu, select Hide.

Columns D and G are not displayed.

Embedding VBA Code to Protect Hidden Columns

Use a VBA code to protect the hidden columns.

  • Press Alt+F11 to open the VBA editor. Select Insert > Module.

Embedding VBA Code to Protect Hidden Columns

  • Enter the following code in the module.
Sub Protect_Hidden_Columns()
Dim HPassword As String
Range("B5:H13").Select
Selection.Locked = True
HPassword = InputBox("Type Password to Protect Hidden Columns")
ActiveSheet.Protect Password:=HPassword
End Sub
  • Close the Visual Basic window.
  • Press Alt+F8.
  • In the Macro dialog box opens, select Protect_Hidden_Columns in Macro name.
  • Click Run.

  • Enter a password to protect the hidden columns.

Embedding VBA Code to Protect Hidden Columns

The hidden columns are protected.

Embedding VBA Code to Protect Hidden Columns


Download Practice Workbook

Download the practice workbook.


<< Go Back to Protect Excel Columns | Excel Protect | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Saquib Ahmad Shuvo
Saquib Ahmad Shuvo

Saquib Ahmad Bhuiyan, holding a BSc degree in Naval Architecture & Marine Engineering from Bangladesh University of Engineering and Technology, skillfully integrates engineering expertise with a passion for Excel. He provides solutions to complex issues as an Excel & VBA Content Developer for ExcelDemy Forum. He demonstrates an enthusiastic mindset and adeptness in managing critical situations with finesse, showcasing his commitment to excellence. Apart from creating Excel tutorials, he is interested in Data Analysis with MS Excel, Rhinoceros,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo