+ Reply to Thread
Results 1 to 2 of 2

Changing chart axis title on inactive sheet

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    2

    Changing chart axis title on inactive sheet

    I have a workbook with two worksheets, one with data, the other with charts of those data. I want to change what is plotted on the charts using a simple dropdown box to select category and values and ideally I would like the chart axes to reflect these changes. All the code I have tried uses the ActiveSheet method like below and this works fine if I am on the actual chart sheet.

    ActiveSheet.ChartObjects("Chart 30").Activate
    'ActiveChart.Axes(xlCategory).Select
    With ActiveChart.Axes(xlCategory)
    .AxisTitle.Text = "blah-de-blah link to cell, etc"
    End With

    BUT, I also want to do this from the data sheet and it doesn't work (runtime error). Is there any way in VBA to access the Chart properties on an INACTIVE worksheet or am I trying to do the impossible?

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Changing chart axis title on inactive sheet

    Hello,

    as with all things concerning charts, it is vital to see the actual data. So many things depend on the data layout. So, please post a workbook with some sample data, your charts and the code you are using.

    Many charting results can actually be achieved without a line of VBA, using well thought-out data layout, range names and a few tricks from the tool box.

    Post your sample file to help us understand the whole picture and can give you advice for your situation.

    cheers,

+ 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