+ Reply to Thread
Results 1 to 2 of 2

Creating chart based on user dropdown for x and y axis

  1. #1
    Registered User
    Join Date
    09-19-2017
    Location
    PA
    MS-Off Ver
    2003
    Posts
    3

    Creating chart based on user dropdown for x and y axis

    Hello all,

    I am struggling to figure out how to graph certain columns from a chart. I created a "sidebar" on the left hand side that is supposed to pull in certain user criteria to sort the data, i just do not know how to code this.

    A user will enter data on the sheet, populating a row per "event".

    I want the user to be able to go into this sheet and create a graph by choosing what columns they want to use for the x and y axis. For example, # people vs. time or Tooling time vs total time.

    I am hoping for this to be the case:

    user selects line #, changeover to and from (or all for this line), data range, and x and y axis.
    a new table will be created on another sheet which is sorted for whatever criteria is selected.


    im assuming coding will look like

    if C21 (the dropdown to select x axis)= #people
    copy column to other sheet to be used as x axis(but how do we have it determine the amount of data in a column to copy it all over?)

    repeat for all criteria and y axis

    then a graph function..? Please help. i have attached the spreadsheet.
    Attached Files Attached Files

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

    Re: Creating chart based on user dropdown for x and y axis

    Hello,

    this can be done without VBA, using range names. Use two range names, one for "myXaxis" and one for "myYaxis". Then build formulas that point the range name to the column selected in the side bar. You may want to use a helper table that shows the number of columns that need to be offset from a starting column (for example offset from column E). You could add a column to the table that you use for the X and Y axis list value. I don't quite know what column is represented with "Changeover Type". You have to help me out here. Also, it is not quite clear what kind of chart you want to create.

    In general the approach goes like this:

    Create one range "myBase" that points to the data in column E, for example. Then enter the column offset for each of the options into column G on the references sheet. You don't really need two lists if X and Y choices are identical, but just in case they may not remain identical, let's go with the current setup. Create the range names for X and Y with the following formulas:

    myXaxis =Offset(myBase,0,vlookup('DATA ENTRY'!$C$21,'REFERENCES - DO NOT TOUCH'!$E$24:$G$32,3,false))
    myYaxis =Offset(myBase,0,vlookup('DATA ENTRY'!$C$22,'REFERENCES - DO NOT TOUCH'!$F$24:$G$32,2,false))

    Then create a chart, manually select X and Y ranges, then edit the chart and plug in the dynamic range names instead.

    What is not quite clear is if you want to plot all populated rows from the Data entry sheet.

    Please clarify.

+ 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. Please Help - Stuck with macro to graph each axis based on dropdown selection
    By matt3606 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2017, 09:22 AM
  2. Replies: 12
    Last Post: 02-07-2014, 04:00 PM
  3. Dropdown Menu in Line Chart and Y axis scale
    By katknight32 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-19-2013, 02:29 PM
  4. Creating a Bar Chart with a Broken X-Axis
    By lzacheung in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 06-27-2011, 05:12 AM
  5. Excel 2007 : Creating a secondary axis for a chart
    By lewis.mulhollen in forum Excel General
    Replies: 1
    Last Post: 09-16-2010, 09:53 AM
  6. Creating a chart with two seperate Y-axis
    By Kara in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-02-2008, 04:50 AM
  7. Creating Pivot Chart with 2 Y axis
    By silks in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-17-2005, 08:32 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