+ Reply to Thread
Results 1 to 8 of 8

SIMPLE Chart Events Question

  1. #1
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    34

    SIMPLE Chart Events Question

    Hey guys,

    I've looked through this article http://www.computorcompanion.com/LPMArticle.asp?ID=221 but it's a bit above my head.

    I've got basic knowledge of VBA and what I'm trying to do is quite simple so I've come here.

    I want code to run depending on which series in a chart is selected.

    E.g.

    Please Login or Register  to view this content.
    I've got the code to run for each series, I'm just not sure how to tie it into a click event.

    Any ideas?

    Cheers,
    Lucas

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: SIMPLE Chart Events Question

    Hi,

    Try this code if the chart is embedded on a worksheet (insert this code into the worksheet's module):
    Please Login or Register  to view this content.
    and insert this in the Worksheet_Activate event:
    Please Login or Register  to view this content.
    If this code is on its own sheet, then use this code instead, on the chart's module:
    Please Login or Register  to view this content.
    Hopefully you can adapt this code to suit your needs.

    If you have any trouble I will be happy to continue helping you with this

  3. #3
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: SIMPLE Chart Events Question

    Hey AJ,

    Where exactly is the Worksheet_activate event? This is what I have so far, all in the worksheet/tab code:

    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: SIMPLE Chart Events Question

    The Worksheet_Activate event is accessible in the Worksheet module (right-click on the worksheet name in Spreadsheet view, and select "View Code" to bring up the Worksheet module). Insert your code from above into this module.

    Hope this helps

  5. #5
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: SIMPLE Chart Events Question

    Hey AJ,

    Hmmm. I've copied all the code above into the Worksheet module... Is that correct? Or is the first part supposed to be somewhere else?

    Nothing seems to be happening so far. Does it matter what type of chart it is? It's a stacked bar...

    Cheers,
    Lucas

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: SIMPLE Chart Events Question

    Hi,

    Can you please upload your workbook here so I can take a look at it? It sounds like you are doing everything in the right place...

    Thanks

  7. #7
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: SIMPLE Chart Events Question

    Hey AJ,

    I can't upload the workbook since it's confidential info. So I replicated the process in a new workbook and of course it worked... Why wouldn't it be working in mine?

    Questions:
    • Do code in other worksheet modules affect this code?
    • Do other tabs being locked have any impact?

    Any other thoughts of what might be stopping the perfectly functioning code from working?

  8. #8
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: SIMPLE Chart Events Question

    I just got an error. Not sure when or why it popped up but see the screenshot below...Attachment 260917

  9. #9
    Registered User
    Join Date
    10-25-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: SIMPLE Chart Events Question

    Hey AJ,

    It's all working now. I think I accidentally reordered some of the code. I've got a couple follow up questions if you're keen. I sent you a private message. Let me know if you can help out

    Cheers,
    Lucas

+ 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. [SOLVED] simple chart question
    By Roney in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 11-23-2005, 11:10 AM
  2. simple chart question
    By Shooter in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-26-2005, 02:05 PM

Tags for this Thread

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