Results 1 to 1 of 1

Chart Sheet Source data does not change when sheets are copied to new workbook

Threaded View

Henk Stander Chart Sheet Source data does... 01-08-2014, 03:01 AM
  1. #1
    Forum Contributor
    Join Date
    05-02-2012
    Location
    Mosselbaai, Suid Afrika
    MS-Off Ver
    Excel 2016
    Posts
    107

    Chart Sheet Source data does not change when sheets are copied to new workbook

    Required: The source data of the graphs, on the chart sheet of the newly created workbook, must automatically be updated to the source data in the newly created workbook.

    I have 2 sheets, one containing the source data for the graphs on a chart sheet, and a chart sheet containing the graphs.

    I need to copy these 2 sheets to a new workbook, where all formulas will be converted to values and very importantly, the source data for the graphs on the chart sheet of the new workbook must be updated to the data source in the new workbook.

    Andy Pope provided me with a macro to achieve this, unfortunately when I checked the sources for the graphs on the chart sheet of the new workbook, it still referred to the data in the original workbook. I have attached 2 files indicating the original workbook and the resulting workbook created after I ran the macro below:

    Sub AndyPopeMacro()
    '
    '
        Dim shtSource As Worksheet
        
        Set shtSource = ThisWorkbook.Worksheets("CPI Summary Sheet")
    '
        ThisWorkbook.Sheets(Array("CPI Summary Sheet", "CPI Charts")).Copy
        
        shtSource.Range("A1", shtSource.Range("A1").SpecialCells(xlLastCell)).Copy
        ActiveWorkbook.Worksheets("CPI Summary Sheet").Range("A1").PasteSpecial _
                            Paste:=xlPasteValuesAndNumberFormats, Operation:=xlNone, _
                            SkipBlanks:=False, Transpose:=False
                            
    End Sub
    Thank you very much
    Last edited by Henk Stander; 01-08-2014 at 07:19 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Chart not updated until chart sheet opened following source data update
    By untilyesterday in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-24-2013, 12:27 PM
  2. how to automatically change source data in a chart?
    By els_pricing_heather in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-29-2011, 10:29 AM
  3. Excel 2007 : Change chart source data in XL2007
    By normc in forum Excel General
    Replies: 2
    Last Post: 12-31-2009, 05:07 PM
  4. Change sheet macro name in a new copied workbook.
    By Richard Buttrey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-27-2009, 03:22 PM
  5. Change source data to all sheets
    By Vlad999 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2006, 07:44 PM

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