Results 1 to 2 of 2

VBA to copy/paste chart format to all other charts in workbook

Threaded View

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question VBA to copy/paste chart format to all other charts in workbook

    Hi All,
    I have a workbook with 159 charts, each on a separate sheet and I want to format the first chart in a particular way and them copy that format to the other 158. I have just done it manually using COPY / PASTE SPECIAL / FORMAT which took a while so I would like to be able to use a macro. I have tried the code below from the peltiertech.com website but nothing happens. I think this code maybe for embedded charts so my query is - can this be modified for charts on separate sheets? if not, how might I best go about it?

    Sub Copy_Chart_Formats()
    
        Dim Sht As Worksheet
        Dim Cht As ChartObject
    
        Application.ScreenUpdating = False
    
        ActiveChart.ChartArea.Copy
    
        For Each Sht In ActiveWorkbook.Worksheets
            For Each Cht In Sht.ChartObjects
                Cht.Chart.Paste Type:=xlFormats
            Next Cht
        Next Sht
    
        Application.ScreenUpdating = True
    
    End Sub
    Many thanks,

    Richard
    Last edited by rarnett; 09-14-2012 at 08:46 AM.

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