+ Reply to Thread
Results 1 to 3 of 3

Switching graphs VBA

  1. #1
    Registered User
    Join Date
    06-19-2015
    Location
    edmonton
    MS-Off Ver
    2010
    Posts
    16

    Switching graphs VBA

    Here is my code

    Sub testcharttype()
    Dim myChart As ChartObject
    Dim ws As Worksheet
    For Each ws In ActiveWorkbook.Worksheets
    For Each myChart In ws.ChartObjects
    If myChart.Chart.ChartType = xlLine Then
    myChart.Chart.ChartType = xlXYScatterLines
    Else
    myChart.Chart.ChartType = xlLineMarkers
    End If
    Next myChart
    Next ws
    End Sub




    .. It works to switch all my graphs from a scatter graph with lines connecting each data point to a line graph with markers. However, it will only switch once then the macro won't work anymore. This is puzzling because if I don't include the "Markers" part it will continuously switch between graphs. But I would like it to switch back and forth AND include markers on the line chart.

  2. #2
    Registered User
    Join Date
    06-19-2015
    Location
    edmonton
    MS-Off Ver
    2010
    Posts
    16

    Re: Switching graphs VBA

    sorry didn't realize there is a VBA section, will keep that in mind for next time.

  3. #3
    Registered User
    Join Date
    06-19-2015
    Location
    edmonton
    MS-Off Ver
    2010
    Posts
    16

    Re: Switching graphs VBA

    Thanks it has been solved

+ 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. Replies: 1
    Last Post: 10-24-2014, 12:20 AM
  2. multiple graphs on one screen and moving graphs
    By mufan in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-12-2014, 04:49 PM
  3. Replies: 4
    Last Post: 07-15-2013, 05:42 AM
  4. [SOLVED] Are there better GRAPHS within EXCEL or Add-on graphs?
    By Deb in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-01-2006, 09:25 AM
  5. [SOLVED] Automatic Graphs/ Dynamic Graphs
    By DanielWalters6 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-24-2006, 05:35 PM

Tags for this Thread

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