+ Reply to Thread
Results 1 to 2 of 2

Moving Charts in Macros

  1. #1
    Registered User
    Join Date
    03-04-2014
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    1

    Moving Charts in Macros

    Hi All,

    Im having a problem when moving charts within a macro. I am sure this question has been asked before but I cant find the answer on search?

    Basically I have used a macro to create a chart, but I then want the chart to always display in the same place on the excel sheet.

    Everytime I run the macro it is looking to move eg 'Chart14' which now no longer exsists because when I create a new chart it defaults the name to Chart15... is this correct?

    Any help is appreciated!

    Alex



    ---------------------
    Sub Table()
    '
    ' Table Macro
    ' Macro recorded 04/03/2014 by researcher1
    '

    '
    Range("J6:J10").Select
    Charts.Add
    ActiveChart.ChartType = xlDoughnut
    ActiveChart.SetSourceData Source:=Sheets("Data").Range("J6:J10"), PlotBy:= _
    xlColumns
    ActiveChart.Location Where:=xlLocationAsObject, Name:="Data"
    ActiveChart.HasLegend = False
    ActiveSheet.Shapes("Chart 45").IncrementLeft -285.75
    ActiveSheet.Shapes("Chart 45").IncrementTop -177#
    ActiveChart.ChartArea.Select
    ActiveSheet.Shapes("Chart 45").ScaleWidth 0.68, msoFalse, msoScaleFromTopLeft
    ActiveSheet.Shapes("Chart 45").ScaleHeight 0.68, msoFalse, msoScaleFromTopLeft
    ActiveWindow.Visible = False
    Windows("New Table.xls").Activate
    Range("A4").Select
    End Sub

  2. #2
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    328

    Re: Moving Charts in Macros

    change name of chart and sizes to suit:
    Please Login or Register  to view this content.
    Sub Reputation()
    Dim Problem as Variant
    Dim Reputation as Integer
    For Each Problem in Forum.Threads
        If Problem.Title = "*[Solved]*" and Solver.Name = "Leon V (AW)" Then Reputation = Reputation + 1
    Next Problem
    End Sub

+ 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. VBA Moving multiple Charts from one sheet to another?
    By kourbeh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2013, 07:42 PM
  2. Excel 07 Charts moving when printed?
    By mikep74 in forum Excel General
    Replies: 0
    Last Post: 04-30-2009, 08:59 PM
  3. Charts moving
    By tlspancap in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-10-2008, 09:43 AM
  4. Excel Charts Moving Around
    By alexschecter in forum Excel General
    Replies: 0
    Last Post: 07-31-2008, 10:40 AM
  5. [SOLVED] Moving Average (Charts)
    By Jamesy in forum Excel General
    Replies: 0
    Last Post: 07-26-2006, 05:15 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