+ Reply to Thread
Results 1 to 4 of 4

Line graph with secondary axes is not treated as xlLine in "select case"

  1. #1
    Registered User
    Join Date
    06-27-2014
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    72

    Line graph with secondary axes is not treated as xlLine in "select case"

    Hello all,

    This is my code:

    Please Login or Register  to view this content.

    When I use this on a xlLine graph with a SECONDARY axes, it refers the graph to Case Else even though it's xlLine, therefore it removes the Legend. Why is that?

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Line graph with secondary axes is not treated as xlLine in "select case"

    Hi,

    When you add the second axis, the chart type changes (at a guess to a custom type)

    In the VBA editor immediate window type "print activechart.charttype" with a line chart selected, and it will return 4

    If you then add a secondary value axis and repeat, it will return -4111
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: Line graph with secondary axes is not treated as xlLine in "select case"

    -4111 = xlCombination

    It can mean a mixture of chart types or use of secondary axis, regardless of chart type.

    You could check the charttype of a specific series
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    06-27-2014
    Location
    Stockholm, Sweden
    MS-Off Ver
    2010
    Posts
    72

    Re: Line graph with secondary axes is not treated as xlLine in "select case"

    Thanks guys, now it works!

+ 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. "If statement" works, but not "select case". What am I doing wrong?
    By max3732 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2014, 12:39 PM
  2. Case Select compile error "Case without case select"
    By coasterman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2012, 06:50 AM
  3. Case Select....The alternative method for long "Select Case"
    By kimyap in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2008, 01:24 AM
  4. changing source data for "Lines on 2 Axes" graph
    By johndough185 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-05-2007, 09:30 PM
  5. How to apply the custom chart type: "Line - Column on 2 Axes"
    By talrs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2006, 04: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