+ Reply to Thread
Results 1 to 4 of 4

Creating SmoothXYScatter plot from scratch (updated below)

  1. #1
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Creating SmoothXYScatter plot from scratch (updated below)

    Hello friends!

    I am going bonkers (mainly because I am not good at all with VB) trying to get a plot to get created after data has been imported into a worksheet.

    What I would like this script to do is:
    1. Create a scatterplot
    2. select prenamed y ranges with x range being same for both primary and secondary y axis.
    3. set some parameters like color and tickmarks
    4. set a range for the x axis based on a cell value date and time (finds date and time in column CE4 on a job report page and subtract 0.010416~ (15 mins) to find the minimum range and add the same amount to get the maximum)

    I have done this already with a sheet that has a plot already there and set up. Ranges are proper and when the data is brought it each series is selected based on their defined names (see below)
    ChartNamedRanges.jpgChartSeries.jpg

    My problem is that I can't get VBA to create a plot from scratch and input the parameters I need to get it up and running as I would if the plot was already there.

    I here is a picture of the code I have so far as well as quoted text of it.

    Please Login or Register  to view this content.
    ChartVBA.jpg

    As you can see I am trying to get each axis set up so my final product can look like this but I think I am confusing VBA syntax heavily here.
    ChartFinal.jpg

    any ideas you can offer would be appreciated!

    Regards,

    D-
    Last edited by Canuckle777; 07-30-2013 at 03:37 PM. Reason: Updated below

  2. #2
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Creating SmoothXYScatter plot from scratch using name defined series.

    Bump for morning eyeballs.

  3. #3
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Creating SmoothXYScatter plot from scratch using name defined series.

    Good morning,

    I managed to update things a bit with some code I found online which creates a plot without using the named ranges. See below:

    Please Login or Register  to view this content.
    It works great in that it builds the plot on the page with the data in it (which I want to export to pdf and remove anyways).

    What I would like to still be able to do is change line weight and color as well as set the minimumscale and maximumscale on the x axis to a cell minus a number for the minimum and plus a number for the maximum. Any recommendations on how to shoehorn that in?

    As well, I would like to change the xlCategory labels to a time value but the below doesn't work.
    Please Login or Register  to view this content.
    Nor does "ActiveChart.blahblahblah.Select work for changing the legend or other parameters. I don't want to reference the Chart name itself as it will be created and destroyed many times in this sheet (could have potentially 50 charts created, converted to pdf and removed in a given use)

  4. #4
    Registered User
    Join Date
    07-04-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Creating SmoothXYScatter plot from scratch using name defined series.

    I am not going to give up on this bad boy. If anyone has some ideas as to my syntax them please share them. I have been all over the web and haven't been able to get this set yet. As of right now This works:
    Please Login or Register  to view this content.
    However, I am still trying to get the scales of the x axis to be Cell (CE4 +/- ANYVALUE). I am getting an error message at this point in the code...
    Please Login or Register  to view this content.
    I thought, maybe I should name the chart so I can reference it specifically instead of using activesheet or activechart because I cannot use "Chart 1" or whatever name is assigned to them as that number changes with each chart created.

    I am pulling this off of another chart that worked when adding values into a cell (below)
    Please Login or Register  to view this content.
    However, this new one won't work because the Chart name is dynamic with each new one and the AC11 and AC12 cells are found on another page in the workbook.

    Should I be asking the folks over in Excel Charts?

+ 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] using checkboxes to plot certain data series on one plot
    By chemeng1T3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2012, 07:08 AM
  2. Creating a graph in VBA using a defined series
    By csr_cafc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2011, 05:34 AM
  3. [SOLVED] Creating Times Series Plot table Excel 2007
    By drmax in forum Excel General
    Replies: 0
    Last Post: 11-21-2009, 12:57 PM
  4. Creating a bar chart from scratch
    By Brad32 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2007, 11:06 AM
  5. [SOLVED] chart data series -- plot a table as a single series
    By hjc in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 09-20-2005, 01:05 PM

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