How to Freeze 2 Columns in Excel (5 Methods)

We have a dataset containing several students’ Names, IDs, Test Scores, etc. As the dataset contains scores of several tests, scrolling right to the worksheet hides columns A and B. We will freeze columns A and B so that columns having Student Name and ID are visible all the time.

5 Methods to Freeze 2 Columns in Excel


Method 1 – Freeze 2 Columns Using the Freeze Panes Option in Excel

Steps:

  • Select the column that is next to the first 2 columns. We selected column C.

Freeze 2 Columns Using Freeze Panes Option in Excel

  • From the Excel Ribbon, go to View, then to Freeze Panes, and click Freeze Panes.

Freeze 2 Columns Using Freeze Panes Option in Excel

  • A gray line appears after column B, and the two columns before that line are frozen.

Freeze 2 Columns Using Freeze Panes Option in Excel

Note:

You can freeze the first two columns by using the keyboard shortcut Alt + W + F + F (pressing one by one).

Read More: How to Freeze First 3 Columns in Excel


Method 2 – Apply the Excel Split Option to Freeze 2 Columns

By applying Split after the first 2 columns, it divides the Excel worksheet areas into two separate areas. In both of these areas, you can scroll the dataset right or left.

Steps:

  • Select column C.

Apply Excel Split Option to Freeze 2 Columns

  • Go to View and select Split.

Apply Excel Split Option to Freeze 2 Columns

  • The corresponding worksheet containing the dataset is split after the first 2 columns. You will see separate scroll areas, too.

Read More: How to Freeze Columns in Excel


Method 3 – Lock 2 Columns Using the Magic Freeze Button in Excel

Steps:

  • Click on the Customize Quick Access Toolbar icon and select the More Commands option.

Lock 2 Columns Using Magic Freeze Button in Excel

  • The Excel Options window will appear.
  • Choose the Freeze Panes command under Popular Commands, click on the Add button, and press OK.

Lock 2 Columns Using Magic Freeze Button in Excel

  • The Magic Freeze button is added to the Quick Access Toolbar.

Lock 2 Columns Using Magic Freeze Button in Excel

  • Similar to Method 1, select column C and click Freeze Panes from the Magic Freeze button.

  • The gray line appears, and the first two columns are frozen.

Read More: How to Unfreeze Columns in Excel


Method 4 – Apply VBA to Freeze 2 Columns in Excel

Steps:

  • Go to the worksheet where you want to freeze 2 columns.
  • Right-click on the sheet name and click on the View Code option to bring up the VBA window.

Apply VBA to Freeze 2 Columns in Excel

  • Copy the below code in the Module. We have written Columns (C:C) in the code, as we want to freeze columns A and B. Change the code as you require.
Sub Freeze2Columns()

    Columns("C:C").Select
    ActiveWindow.FreezePanes = True

End Sub

Apply VBA to Freeze 2 Columns in Excel

  • Run the code by pressing the F5 key or clicking on the Run icon (see the screenshot).

Apply VBA to Freeze 2 Columns in Excel

  • The first two columns of the worksheet are frozen.

Read More: How to Freeze Top Row in Excel


Method 5 – Freeze Rows and 2 Columns Simultaneously

Steps:

  • Click Cell C5 (Cell right to the column and below to the row you want to freeze).

Freeze Rows and 2 Columns Simultaneously

  • Go to View, then to Freeze Panes, and select Freeze Panes.
  • Two grey lines appear, which indicate that the first 2 columns and the top 4 rows are frozen.

Read More: How to Freeze Top Two Rows in Excel 


Unfreeze Columns in Excel

Steps:

  • Go to the worksheet where columns are frozen.
  • Go to View, select Freeze Panes, and click on Unfreeze Panes.

Unfreeze Columns in excel

Note:

You can apply this keyboard shortcut to unfreeze columns: Alt + W + F + F

Related Content: How to Freeze Top 3 Rows in Excel


Download the Practice Workbook


Related Articles


<< Go Back to Freeze Panes | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Hosne Ara
Hosne Ara

Hosne Ara is a materials and metallurgical engineer who loves exploring Excel and VBA programming. To her, programming is like a time-saving superhero for dealing with data, files, and the internet. She's skilled in Rhino3D, Maxsurf C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. With a B. Sc. in Materials and Metallurgical Engineering from Bangladesh University of Engineering and Technology, she's shifted gears and now works as a content developer. In this role, she... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo