+ Reply to Thread
Results 1 to 5 of 5

How to include a chart title in a Macro

  1. #1
    Forum Contributor
    Join Date
    01-25-2013
    Location
    nottingham
    MS-Off Ver
    Excel 2007
    Posts
    128

    How to include a chart title in a Macro

    Hello,

    I have created a macro which is shown below which creates a graph. However, i need the chart to include a chart title automatically inside the macro.

    Doe anyone know how to do this?

    Please Login or Register  to view this content.


    I want the chart title to be "Total Un-sourced parts per SCU"


    Thank you!

  2. #2
    Forum Contributor codeslizer's Avatar
    Join Date
    05-28-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003 - 2010
    Posts
    245

    Re: How to include a chart title in a Macro

    Hey there buddy,

    You could use ChartTitle.Text property under ActiveChart. To do that, select the chart first and then set the text. Try following code and see if meets your requirement. Say, if your chart name is "Chart 1" then,

    Please Login or Register  to view this content.
    cOdEsLiZeR - Back after a long break.. Let's sLiZe some more cOdEs!!

  3. #3
    Forum Contributor
    Join Date
    01-25-2013
    Location
    nottingham
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: How to include a chart title in a Macro

    Thank you for your response.

    I created the chart and it is named chart 17 (due to creating so many).

    On this excel page, there will be many charts being created so linking the chart title to a specific chart name will be difficult.

    is there any way of inserting something in the macrowhich just names the chart it is actually creating and not linking it to a specific chart name?

  4. #4
    Forum Contributor
    Join Date
    01-25-2013
    Location
    nottingham
    MS-Off Ver
    Excel 2007
    Posts
    128

    Re: How to include a chart title in a Macro

    doesn't matter, have solved this myself, having a 'blonde' day today!

  5. #5
    Forum Contributor codeslizer's Avatar
    Join Date
    05-28-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003 - 2010
    Posts
    245

    Re: How to include a chart title in a Macro

    Yes, avoid Selection then. As soon as you add a chart to the sheet, be default, it'll be the active chart. Simply, add a title to the chart (if the chart has more than one data columns - which is your case) and use the Text property to change the title. For single column data the title is available by default. Try following code, might see some good results

    Please Login or Register  to view this content.

+ 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. Macro to Change Portion of Chart Title
    By foxy_420 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2013, 11:31 AM
  2. Replies: 2
    Last Post: 01-30-2011, 11:38 AM
  3. Macro Chart Title
    By lvish in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2009, 01:25 AM
  4. Set chart axis title within Macro
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-27-2008, 05:34 AM
  5. Pasting Objects into Chart title and Axis title
    By Sam in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-06-2005, 04:05 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