Results 1 to 16 of 16

Using Dynamic Ranges for Excel Charts

Threaded View

  1. #15
    Registered User
    Join Date
    02-01-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Using Dynamic Ranges for Excel Charts

    I see your issue. When you add lines, and want to update the chart, you have to go back and put in the new range, by simply typing in ChartNoNA. The only way around this is running a macro. I created one by using record.

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    
    '
        ActiveSheet.ChartObjects("Chart 1").Activate
        ActiveChart.PlotArea.Select
        ActiveSheet.ChartObjects("Chart 1").Activate
        ActiveChart.SeriesCollection(3).Select
        ActiveSheet.ChartObjects("Chart 1").Activate
        ActiveChart.SetSourceData Source:=Range("ChartNoNA")
       ' ActiveChart.SetSourceData Source:=Range("B2:AX11")
    End Sub
    See the attached sheet, I made it run when you change something on the worksheet.

    When you insert rows, it will give you a small error about #REF, but when you hit OK, the chart is updated.

    You must enable macros security settings.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

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