+ Reply to Thread
Results 1 to 4 of 4

Help making a chart title from cell contents.

  1. #1
    Registered User
    Join Date
    01-10-2014
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Question Help making a chart title from cell contents.

    Hi,

    I'm stumped! I am trying to make the contents of a cell into a chart title.
    I know I can do it like this...

    ActiveChart.ChartTitle.Select
    Selection.Caption = "=tab_name!R2C1"

    However, I am trying to use the same macro on several different tabs in
    the same EXCEL worksheet. Obviously, I can't have the tab name in the
    macro. But, I don't get a title at all when I try to remove it like this...

    ActiveChart.ChartTitle.Select
    Selection.Caption = "=R2C1"

    or
    ActiveChart.ChartTitle.Select
    Selection.Caption = "=A2"

    Is this possible?

    I am (kinda new at) using EXCEL2010.

    Thanks,
    Michelle

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Help making a chart title from cell contents.

    Try something like this, which will loop through all charts on all worksheets, and set the title to a cell reference on each worksheet:

    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    01-10-2014
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Help making a chart title from cell contents.

    Thank you so much!!!

    Your code did way more than I needed. But, I was able to get the general format I required.
    This is all the code I needed: (Quite basic... But, again, I'm a newbie!)

    ActiveChart.ChartTitle.Select
    Selection.Caption = "=" & ActiveSheet.Name & "!R2C1"

    But, I'm happy for the entire code you sent. I am sure I'll be able to use that some time too!

    Thanks again!
    Michelle

    BTW - Nice bike!

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Help making a chart title from cell contents.

    Good, glad it solved your immediate problem, and perhaps gave some further ideas

    Thanks for the compliment

+ 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. Using cell contents to search for corresponding sheet title
    By teblowtime in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2013, 03:31 PM
  2. Insert Cell contents into Chart Title
    By swatsp0p in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-16-2010, 06:29 PM
  3. Making Chart Titles equal Cell Contents
    By JohnGuts in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-27-2007, 03:01 AM
  4. Retrieving the formula contents of a chart title
    By jmcdaid@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2005, 01:55 AM
  5. Insert contents of a cell into a title of a chart
    By greg stenzel in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-20-2005, 08:06 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