How to Hide Columns in Excel? (Using Top 4 Methods)
Below mentioned are the top 4 methods that can easily help you to hide the columns in excel
- Hide Column using Right Click Option
- Hide Column using Shortcut Cut Key
- Hide Column using Column WidthColumn Using Column WidthA user can set the width of a column in an excel worksheet between 0 and 255, where one character width equals one unit. The column width for a new excel sheet is 8.43 characters, which is equal to 64 pixels.
- Hide Column using VBA CodeVBA CodeVBA code refers to a set of instructions written by the user in the Visual Basic Applications programming language on a Visual Basic Editor (VBE) to perform a specific task.
Now let us discuss each of the methods in detail along with an example –
#1 Hide Columns using Right Click
In the below-displayed worksheet, in Employee Data, We need to hide the B and C column as it consists of First and Last Name individually, and we have concatenated (merged) the names in the D column, and we want only that to be displayed.
|Emp ID||First Name||Last Name||Full Name||Gender||Age||Department|
|00004||Vaibhav||Bansal||Vaibhav Bansal||Male||45||Product Development|
Following are the steps used to hide columns using right click-
- We need to click on B (Column Label) with the mouse (when we move the pointer to the label of the columns that gets converted to the downward arrow) and then while pressing Ctrl+Shift, we need to press ‘Right Arrow Key‘ also to select the right-side column (C).
- Right-click to open the context menu and then choose the ‘Hide.’
#2 Hide Column in Excel using Shortcut Key (CTRL+0)
- For example, Select Column B and C (Ctrl+Spacebar could also be used to select a column) and use the Shortcut key Ctrl + 0 (Zero) to hide a column in excel.
#3 Hide Column in Excel using Column Width
- Select column B and C, right-click to open the context menu, and then choose ‘Column Width’ and specify the width to be ‘0’.
#4 Hide Column in Excel using VBA
- Step 1: On the Developer tabDeveloper TabEnabling the developer tab in excel can help the user perform various functions for VBA, Macros and Add-ins like importing and exporting XML, designing forms, etc. This tab is disabled by default on excel; thus, the user needs to enable it first from the options menu., click on ‘Visual Basic’ to open the window for writing VBA Code
- Step 2: After double clicking on the ‘Sheet 1’, Click on ‘Insert’ Menu->‘Procedure’->Specify the procedure name and paste the following code: Worksheets(“Sheet1”).Columns(“C”).Hidden = True
- Step 3: Before clicking on ‘Run’ Menu->Run Sub/User Form, Save the file with .xlsm extension as this is for ‘Macro-Enabled Workbook.’
- Step 4: After hiding column B and C, the sheet will look like as below. There is ‘Double Line’ between A and D as column B and C is hidden between them.
This has been a guide to hiding columns in excel. Here we discuss the top 4 methods to hide columns in excel, including right-click, shortcut (CTRL+0), column width, and VBA Code. You can learn more about excel from the following articles –