How to hide or show chart axis in Excel?
Maybe in some cases, you will want to hide the chart axis in Excel. This tutorial will tell you how to hide or show chart axis in Excel.
Hide or show chart axis in Excel
Hide or show chart axis with VBA
Hide or show chart axis in Excel
In Excel 2007/2010
1. Click the chart to show Chart Tools in the Ribbon, then click Layout > Axes. See screenshot:
2. In Axes list, select the axis you want to hide, and then click None. See screenshot:
Then the axis will be hidden.
In Excel 2013
1. Click the chart to show Chart Tools in the Ribbon, then click Design > Add Chart Element. See screenshot:
2. In the list, click Axes, and then select the axis you want to hide.
Then the axis will be hidden.
Remove chart axis with VBA
If you are interested in VBA code, you can use the follow code to remove the axis.
1. Select a chart and hold on Alt + F11 keys to open Microsoft Visual Basic for Applications window.
2. Then click Insert > Module to insert a Module window, and then copy the following VBA into it.
VBA: Remove X axis from chart.
Sub XLabelHidden()
'Updateby20140911
Dim xChart As Chart
Dim xChartArea As ChartArea
If VBA.TypeName(Application.Selection) = "ChartArea" Then
Set xChartArea = Application.Selection
Set xChart = xChartArea.Parent
With xChart.Axes(XlAxisType.xlCategory).TickLabels.Font
.ColorIndex = 2
.Background = xlTransparent
End With
End If
End Sub
3. Click Run or press F5 to run the code. Then the selected chart’s X axis is removed.
Note: This VBA code only works on removing X axis, and the removed axis cannot be shown again.
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!