Results 1 to 2 of 2

VBA Code to Auto Adjust Chart Axes Dependent Upon Cell Entry

Threaded View

  1. #1
    Registered User
    Join Date
    09-05-2017
    Location
    Colorado
    MS-Off Ver
    10
    Posts
    2

    Question VBA Code to Auto Adjust Chart Axes Dependent Upon Cell Entry

    I have an excel chart that I want to always be symmetrical. I am trying to write a code so that my chart will automatically adjust the x and y axes according to the value entered in a cell. The code I am using doesn't seem to be working so I am reaching out for help. Below is the code I have now and a picture of the spreadsheet. Any help would be GREATLY appreciated.

    Private Sub Worksheet_Change(ByVal Target As Range)
    With ActiveSheet.ChartObjects("Input_Luminaire_Data_Chart").Chart
    Select Case Target.Address
    'Y Axis
    Case "$N$33"
    .Axes(xlValue).MaximumScale = Target.Value
    Case "$N$32"
    .Axes(xlValue).MinimumScale = Target.Value
    'X Axis
    Case "$M$33"
    .Axes(xlCategory).MaximumScale = Target.Value
    Case "$M$32"
    .Axes(xlCategory).MinimumScale = Target.Value
    End Select
    End With
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA Code to Auto Adjust Chart Axes Dependent Upon Cell Entry
    By rhenry54 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2017, 03:32 PM
  2. [SOLVED] How to adjust row height of row so tall the point to grab to adjust auto falls below
    By juntjoo in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 06-22-2016, 02:07 PM
  3. VBA code for pulling a sequential number from a text file dependent on a form entry.
    By gjwilson1216 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2013, 05:16 AM
  4. Custom number format code for hiding specific values on chart axes
    By rob_storrar in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 11-25-2012, 12:27 AM
  5. [SOLVED] The VBA code to auto-clear dependent drop down selection when parent cell change.
    By Hotgirl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-29-2012, 07:48 PM
  6. Auto Adjust VBA Code
    By skankingpigeon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2012, 04:31 PM
  7. Merging code for hiding columns and setting chart axes values
    By tuckjoseph in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-23-2010, 01:19 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1