Results 1 to 2 of 2

VBA Secondary Axis - Line Chart

Threaded View

hobbiton73 VBA Secondary Axis - Line... 08-22-2014, 03:32 AM
hobbiton73 Re: VBA Secondary Axis - Line... 08-22-2014, 04:02 AM
  1. #1
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    VBA Secondary Axis - Line Chart

    Hi, I wonder whether someone may be able to help me please.

    Using a link I found here:
    http://http://www.mrexcel.com/forum/excel-questions/485714-creating-chart-dynamic-range-size-visual-basic-applications.html I've put together the following code which creates a chart from a dynamic range.

    Sub Test()
    
        Dim LastRow As Long
        Dim Rng1 As Range
        Dim ShName As String
        
        Sheets("All CDIO F'cst").Select
        
        With ActiveSheet
            LastRow = .Range("B" & .Rows.Count).End(xlUp).Row
            Set Rng1 = .Range("B9:N" & LastRow)
            ShName = .Name
        End With
        Charts.Add
        With ActiveChart
            .ChartType = xlColumnClustered
            .SetSourceData Source:=Rng1
            .Location Where:=xlLocationAsObject, Name:=ShName
        End With
    End Sub
    I am however a little unsure about how to progress this. I'd like to add a secondary axis as a line which appears on the chart ranging from "B8:N8 with B8 the Legend for the data series.

    I just wondered whether someone may be able to look at this please and offer some guidance on how I may achieve this.

    Many thanks and kind regards

    Chris
    Last edited by hobbiton73; 08-22-2014 at 03:51 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel 2007 : Secondary X Axis in Line Chart
    By goel in forum Excel General
    Replies: 6
    Last Post: 02-01-2011, 07:27 AM
  2. Secondary Axis line chart formatting
    By AlphaBob in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 12-06-2008, 09:11 AM
  3. Replies: 2
    Last Post: 08-12-2005, 08:05 AM
  4. [SOLVED] Pivot Table, Line Chart with Secondary Y axis, Page Field selection destroys Y2 axis
    By mw210461@yahoo.com in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-13-2005, 05:05 PM
  5. how can i add a secondary y-axis to a bar chart (not a line chart)
    By edbianc in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 02-18-2005, 10:06 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