Results 1 to 9 of 9

create multiple x y charts, one for each column with the same x axis using excel-vba

Threaded View

  1. #2
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: create multiple x y charts, one for each column with the same x axis using excel-vba

    Name column B Xaxis and columns E to R data

    Sub plot()
    
    Dim c As Range
    
    For Each c In Range("Data").Rows(1).Cells
    
    
    Charts.Add
    ActiveChart.ChartType = xlLineMarkers
    ActiveChart.Location Where:=xlLocationAsNewSheet, Name:=c.Value
    ActiveChart.SetSourceData Source:=Union(Range("xaxis"), c.Resize(Range("xaxis").Rows.Count, 1))
    With ActiveChart
        .HasTitle = True
        .ChartTitle.Characters.Text = c.Value
        .Axes(xlCategory, xlPrimary).HasTitle = True
        .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Date"
        .Axes(xlValue, xlPrimary).HasTitle = True
        .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = c.Value
    End With
    
    Next c
    
    End Sub
    Attached Files Attached Files
    Please consider adding a * if I helped.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How do I plot multiple x-axis series in excel charts
    By bdorr in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-22-2018, 08:52 PM
  2. Replies: 3
    Last Post: 10-16-2014, 02:01 PM
  3. Replies: 3
    Last Post: 02-05-2012, 10:04 AM
  4. Replies: 0
    Last Post: 07-28-2011, 02:11 AM
  5. Create and customize axis on all sides of charts
    By Nicholas in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-18-2006, 09:25 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