• Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
    • Microsoft Visual
    • Microsoft Project
    • Microsoft Visio
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us
Excel

How to automatically adjust chart axis scaling in Excel

0 Comments

How to automatically adjust chart axis scaling in Excel. Creating a chart in Excel is very simple, but dividing the X and Y axis scaling symmetrically and aesthetically is still a problem for many Excel users. In this article, UniTrain will guide you through two automatic methods to adjust chart axis scaling in Excel: 1. Using the Format Axis feature in Excel 2. Running VBA code in Excel

1. Using the Format Axis feature to change adjust chart axis scaling in Excel

To automatically change the chart axis by using the Format Axis feature in Excel, follow these steps:

Step 1: Create data for the X and Y axes (as shown below).

How to automatically adjust chart axis scaling in Excel

How to automatically adjust chart axis scaling in Excel

Step 2: Insert a 2-D column chart by selecting cell B4 > Insert > selecting the chart icon and inserting a column chart (as shown below).

How to automatically adjust chart axis scaling in Excel

How to automatically adjust chart axis scaling in Excel

Then, the column chart will be displayed as shown below:

How to automatically adjust chart axis scaling in Excel

How to automatically adjust chart axis scaling in Excel

Step 3: Right-click and select Format Axis.

How to automatically adjust chart axis scaling in Excel

How to automatically adjust chart axis scaling in Excel

Then, select Axis option > Units > change it to 3000.

How to automatically adjust chart axis scaling in Excel

How to automatically adjust chart axis scaling in Excel

You will see that Maximum Bounds will automatically change from 20000 to 21000, and the unit of the Y-axis will change from 2000 to 3000 as shown below:

How to automatically adjust chart axis scaling in Excel

How to automatically adjust chart axis scaling in Excel

However, for the X-axis, users cannot change the scaling because they are using text instead of values. That’s why users keep the chart’s horizontal data unchanged. Right-click > select Format Axis > select Automatically select based on data in the Axis Type section and Automatic in the Vertical axis crosses section.

adjust chart axis scaling 72. Run Excel VBA code to automatically change chart axis scale

Procedure: Step 1: Select Developer > Visual Basic.

adjust chart axis scaling 8When the Microsoft Visual Basic for Applications window appears, select Insert > Module.

adjust chart axis scaling 9Step 2: Insert the code below into the Module.

Function ChartAxisScale(sheetName As String, chartName As String, MinOrMax As String, _
ValueOrCategory As String, PrimaryOrSecondary As String, Value As Variant)
Dim chart As chart
Dim text As String
‘Set the function to control the chart
Set chart = Application.Caller.Parent.Parent.Sheets(sheetName) _
.ChartObjects(chartName).chart
‘Set Primary axis Value
If (ValueOrCategory = “Value” Or ValueOrCategory = “Y”) _
And PrimaryOrSecondary = “Primary” Then
With chart.Axes(xlValue, xlPrimary)
If IsNumeric(Value) = True Then
If MinOrMax = “Max” Then .MaximumScale = Value
If MinOrMax = “Min” Then .MinimumScale = Value
Else
If MinOrMax = “Max” Then .MaximumScaleIsAuto = True
If MinOrMax = “Min” Then .MinimumScaleIsAuto = True
End If
End With
End If
‘Set Primary axis Category
If (ValueOrCategory = “Category” Or ValueOrCategory = “X”) _
And PrimaryOrSecondary = “Primary” Then
With chart.Axes(xlCategory, xlPrimary)
If IsNumeric(Value) = True Then
If MinOrMax = “Max” Then .MaximumScale = Value
If MinOrMax = “Min” Then .MinimumScale = Value
Else
If MinOrMax = “Max” Then .MaximumScaleIsAuto = True
If MinOrMax = “Min” Then .MinimumScaleIsAuto = True
End If
End With
End If
‘Set secondary axis value
If (ValueOrCategory = “Value” Or ValueOrCategory = “Y”) _
And PrimaryOrSecondary = “Secondary” Then
With chart.Axes(xlValue, xlSecondary)
If IsNumeric(Value) = True Then
If MinOrMax = “Max” Then .MaximumScale = Value
If MinOrMax = “Min” Then .MinimumScale = Value
Else
If MinOrMax = “Max” Then .MaximumScaleIsAuto = True
If MinOrMax = “Min” Then .MinimumScaleIsAuto = True
End If
End With
End If
‘Set secondary axis category
If (ValueOrCategory = “Category” Or ValueOrCategory = “X”) _
And PrimaryOrSecondary = “Secondary” Then
With chart.Axes(xlCategory, xlSecondary)
If IsNumeric(Value) = True Then
If MinOrMax = “Max” Then .MaximumScale = Value
If MinOrMax = “Min” Then .MinimumScale = Value
Else
If MinOrMax = “Max” Then .MaximumScaleIsAuto = True
If MinOrMax = “Min” Then .MinimumScaleIsAuto = True
End If
End With
End If
If IsNumeric(Value) Then text = Value Else text = “Auto”
ChartAxisScale = ValueOrCategory & ” ” & PrimaryOrSecondary & ” ” _
& MinOrMax & “: ” & text
End Function
Sub Axis_Scale()
End Sub

adjust chart axis scaling 10Then, select Run > Run Sub/UserForm.

adjust chart axis scaling 11
After running the VBA code, you can create a user-defined function.
Then, go back to the Excel worksheet, select cell B20 and enter: =ChartAxisScale(“Sheet1″,”Chart 2″,”Max”,”Value”,”Primary”,C19)

adjust chart axis scaling 12

Rate this post
28
274 Views
Moving a window to another screen on Windows 10PrevMoving a window to another screen on Windows 10March 27, 2023
How to Change Default Browser in Windows 10March 27, 2023How to Change Default Browser in Windows 10Next

Leave a Reply Cancel reply

You must be logged in to post a comment.

Buy Windows 11 Professional MS Products CD Key
Buy Office 2021 Professional Plus Key Global For 5 PC
Top rated products
  • AVG Ultimate 2021 with Antivirus + Cleaner, Secure VPN 10 Devices 2 Years AVG Ultimate 2021 with Antivirus + Cleaner, Secure VPN 10 Devices 2 Years
    Rated 5.00 out of 5
    $47.00
  • Avast Premium Security 2021 10 Devices 1 Year Global Avast Premium Security 2021 10 Devices 1 Year Global
    Rated 5.00 out of 5
    $28.00
  • Avast Ultimate Suite 2021 3 Years 10 Devices Global Avast Ultimate Suite 2021 3 Years 10 Devices Global
    Rated 5.00 out of 5
    $90.00
  • Windows Server 2022 Remote Desktop Services Device Connections (50) Cal Key Global Windows Server 2022 Remote Desktop Services Device Connections (50) Cal Key Global
    Rated 5.00 out of 5
    $22.00
  • Kaspersky Internet Security 2021 1 year 1 device key Global Kaspersky Internet Security 2021 1 year 1 device key Global
    Rated 5.00 out of 5
    $24.00
Products
  • Microsoft SQL Server 2019 Enterprise Microsoft SQL Server 2019 Enterprise $39.00
  • Avast Ultimate Suite 2021 2 Years 10 Devices Global Avast Ultimate Suite 2021 2 Years 10 Devices Global
    Rated 5.00 out of 5
    $77.00
  • Buy Windows 11 Home CD Key Global Buy Windows 11 Home CD Key Global
    Rated 4.73 out of 5
    $6.00
  • Windows Server 2016 Remote Desktop Services 50 USER Connections Key Global Windows Server 2016 Remote Desktop Services 50 USER Connections Key Global
    Rated 4.74 out of 5
    $15.00
  • Office 2019 Professional Plus Key Global Bind to your Microsoft Account Office 2019 Professional Plus Key Global Bind to your Microsoft Account
    Rated 4.97 out of 5
    $49.00
  • Avast SecureLine VPN 2021 2 Years 5 Devices Global Avast SecureLine VPN 2021 2 Years 5 Devices Global
    Rated 5.00 out of 5
    $47.00
  • Microsoft Visual Studio Enterprise 2022 For 1 PC Microsoft Visual Studio Enterprise 2022 For 1 PC $19.00
  • AVG Internet Security 2021 10 Devices 1 Year Global AVG Internet Security 2021 10 Devices 1 Year Global
    Rated 5.00 out of 5
    $30.00
  • Trend Micro Maximum Security 3 Devices 1 Year key Global Trend Micro Maximum Security 3 Devices 1 Year key Global
    Rated 5.00 out of 5
    $15.00
  • Trend Micro Internet Security 3 Devices 1 Year Key GLOBAL Trend Micro Internet Security 3 Devices 1 Year Key GLOBAL
    Rated 5.00 out of 5
    $17.00
Product categories
  • Anti Virus
  • Microsoft Office
  • Microsoft Project
  • Microsoft Visio
  • Microsoft Visual
  • Microsoft Windows
  • Other Software
  • Uncategorized

Buffcom.net always brings the best digital products and services to you. Specializing in Office Software and online marketing services

BIG SALE 50% IN MAY

Microsoft Office
Microsoft Windows
Anti-Virus
Contact Us

Visit Us:

125 Division St, New York, NY 10002, USA

Mail Us:

buffcom.net@gmail.com

TERMS & CONDITIONS | PAYMENT GUIDE  | SHIPPING POLICY  | REFUND POLICY

Copyright © 2019 buffcom.net  All Rights Reserved.