+ Reply to Thread
Results 1 to 5 of 5

Lock everything but X-axis?

  1. #1
    Registered User
    Join Date
    10-26-2015
    Location
    USA
    MS-Off Ver
    Office 2007
    Posts
    19

    Lock everything but X-axis?

    Is there a way, using VBA or Excel, to lock every chart element except modifying the X-axis? It's a pain on a slow graph to click and suddenly the entire object moves, but I would like to modify the x-axis to focus in on certain time periods of data.

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Lock everything but X-axis?

    It is possible to change scale of axis with vba. Also you may adjust chart data source with dynamic named range. No code is necessary for this.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Lock everything but X-axis?

    Hello,

    assuming you are using a Scatter (XY) chart, you can change the X axis min and max settings to zoom in on a specific time frame, but if the chart is very busy, it's very likely that a click does not hit the axis and things go awry.

    As an alternative you could filter the source data. By default, charts will only show data that is visible in the source table after a filter is applied. Consider the following screenshot.

    The data table has values for January to August. A chart has been created for the whole data range. The the table was filtered to show only the data for February and April. Consider this screenshot ( if the forum can get its act together and show the picture, otherwise, click the link).

    2015-11-20_22-45-56.gif

    The data source is in an Excel Table (Insert > Table), which has great tools to sort and filter data.

    Please let me know if you need more information to make this work for you.

    cheers, teylyn
    Last edited by teylyn; 11-20-2015 at 05:53 AM.

  4. #4
    Registered User
    Join Date
    10-26-2015
    Location
    USA
    MS-Off Ver
    Office 2007
    Posts
    19

    Re: Lock everything but X-axis?

    My data isn't in a table, but is sourced from equations on a different page. I have the entire graph locked. I considered something similar to teylyn's solution, but the data is cumulative and rolling. I have six standard deviation lines derived from the entire data set displaying and hiding cels changes their values.

    So my question isn't that the x-axis can be changed with VBA or Excel. I want to change the dates manually. The question becomes if I can lock the other chart elements so I don't inadvertently click on something while the graph slowly loads, similar to locking specific cels in a Protected Worksheet.

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Lock everything but X-axis?

    If you are happy to use VBA, you could use two cells to define the min an max of the chart. Use a Worksheet_Change event to monitor these two cells and adjust the axis min and max according to the values entered in the cells.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Two Y Axis's One X, Chart Data not in sync with X axis between Y axis's
    By MJSlattery in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-08-2013, 12:08 AM
  2. [SOLVED] Bar Graph With 2 Axis - Bars On The Primary Axis Overlap Bars On The Secondary Axis
    By Variablez in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-11-2013, 08:38 AM
  3. Replies: 2
    Last Post: 02-22-2012, 10:10 AM
  4. Replies: 8
    Last Post: 02-12-2009, 10:12 AM
  5. Can I lock cells or do I have to lock the worksheet?
    By jmbtexas in forum Excel General
    Replies: 4
    Last Post: 11-11-2008, 02:26 PM
  6. Lock shape location to axis values?
    By William DeLeo in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 12-29-2005, 09:09 AM
  7. How can Excel vba detect if Caps Lock or Num Lock is on?
    By abc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2005, 02:20 AM
  8. [SOLVED] How to insert X axis scale values next to axis and X axis grid lin
    By vp23larry in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-23-2005, 11:05 AM

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