+ Reply to Thread
Results 1 to 11 of 11

Replace text in multiple charts

  1. #1
    Registered User
    Join Date
    10-07-2006
    Posts
    3

    Exclamation Replace text in multiple charts

    I have an excel file that contains more than 200 charts.

    Now I want to replace some text in all these charts' title, title of X-axis, title of Y-axis and text in legend.

    Apparently it is a cumbersome task if I do it manually.

    Is there automated way, like using VBA to do it?

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Replace text in multiple charts

    Hi
    this macro should replace text in chart and axis titles. Note it is case sensitive.

    The case of legends is a bit different because these often are linked to cells on your worksheet containing the source data - do you want to overwrite such links and include an unlinked name? If so, this can be added.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-07-2006
    Posts
    3

    Re: Replace text in multiple charts

    Thank you Nick,

    Yes, I want to overwrite the link for the legend, actually I use unlinked text for the legend in the charts.

  4. #4
    Registered User
    Join Date
    10-07-2006
    Posts
    3

    Re: Replace text in multiple charts

    BTW: why the variable "SearchString" in the 2nd line of the VBA code has no definition?

  5. #5
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Replace text in multiple charts

    Searchstring should be defined as a string, I just overlooked it
    '
    try this verison - I have also added a couple of inputboxes so the user can input the strings to find and replace

    Please Login or Register  to view this content.
    Last edited by NickyC; 10-18-2012 at 06:03 AM. Reason: add code tags

  6. #6
    Registered User
    Join Date
    10-07-2006
    Posts
    3

    Re: Replace text in multiple charts

    It works like a charm

    Thanks again, Nick.

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Replace text in multiple charts

    @ netsonic

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as an infrequent user of the forum, you may have forgotten (or may not be aware) that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  8. #8
    Registered User
    Join Date
    09-12-2016
    Location
    Baltimore, MD
    MS-Off Ver
    2010
    Posts
    1

    Re: Replace text in multiple charts

    Big thanks NickyC!

  9. #9
    Registered User
    Join Date
    04-11-2017
    Location
    derp
    MS-Off Ver
    derp
    Posts
    1

    Re: Replace text in multiple charts

    5 years later and this just saved me from hours of work. Thanks!

  10. #10
    Registered User
    Join Date
    04-11-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2016 Professional
    Posts
    1

    Re: Replace text in multiple charts

    Lightning strikes twice in the same day. Same same and saved me heaps of time. Thanks muchly!

  11. #11
    Registered User
    Join Date
    07-17-2019
    Location
    Indonesia
    MS-Off Ver
    MS OFFICE 2010
    Posts
    1

    Wink Re: Replace text in multiple charts

    Thanks to you my master

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Replace text in multiple charts

    Always good to see older threads still helping members
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

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