+ Reply to Thread
Results 1 to 10 of 10

EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

  1. #1
    Registered User
    Join Date
    08-06-2020
    Location
    HCM city
    MS-Off Ver
    2010
    Posts
    6

    Question EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    I am a new learner in excel macros. I am trying to export the value (x, y) of 1 point in 1 series by point one-clicking.
    Ex. I have a chart X-Y with 3 points A (1, 2); B (3,4); C(5,6)..... when I click on point "A" on this chart, the X value and y Value will be defined in A1 and B1 cells
    . Next, when I click a single point "B" or "C" on this chart, the X value and y Value will be updated in A1 and B1 cells. Many thanks for your help!

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    You are jumping in at the deep end if you are wanting to code against the charts events


    If you use a chart sheet then you can write code within the chart events of the chart sheet.
    Not that you will need to click the first data point twice in order to identify individual data points.

    If you use a chartobject then you will need to create a class to expose those same chart events.

    standard code module
    Please Login or Register  to view this content.
    class module, CChtEvnt
    Please Login or Register  to view this content.
    There is a button on the worksheet that runs the code to initiate the class to listen for chart events.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-06-2020
    Location
    HCM city
    MS-Off Ver
    2010
    Posts
    6

    Re: EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    Thanks for your help. I am so appreciated.
    I will try to match it to my file as a chart object. Hope you could accept for my comeback if I fail
    Many thanks again! Andy.

  4. #4
    Registered User
    Join Date
    08-06-2020
    Location
    HCM city
    MS-Off Ver
    2010
    Posts
    6

    Re: EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    Please help me to re-fix this macro. when i moved chart to new sheet and the macro didn't work. Many thanks.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    You will have to post your workbook, as per instructions at top of page, as you have provided no additional information in order for us to help you

  6. #6
    Registered User
    Join Date
    08-06-2020
    Location
    HCM city
    MS-Off Ver
    2010
    Posts
    6

    Re: EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    I have tried many time to attach my file but supposedly the internet security in my country could not accept it even the hyperlink.

    Many thanks with appreciation.
    Last edited by lambaonguyen; 08-10-2020 at 05:35 AM.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    You have not provided a link.

    Make sure you are following the instructions in the yellow banner, and not trying to use the 'paper clip' to attach example

    Members are reluctant to click on non forum down loads.

  8. #8
    Registered User
    Join Date
    08-06-2020
    Location
    HCM city
    MS-Off Ver
    2010
    Posts
    6

    Re: EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    Thank Andy,
    Due to moving the chart to the new sheet, the macro did not understand this line (With ThisWorkbook.Worksheets("Sheet1")").
    So after trying many ways in desperation, I randomly change to (With active chart) and it's work. Thanks again, Andy.
    Btw, my account is not a VIP one so I have to pay money to post links and pictures, supposedly.

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    Glad you sorted it. Did you try changing the name of Sheet1 to whatever then sheet tab is called in your workbook?


    No, you can attach files.
    Links require a number of posts before you can use them.

  10. #10
    Registered User
    Join Date
    08-06-2020
    Location
    HCM city
    MS-Off Ver
    2010
    Posts
    6

    Re: EXPORT A POINT VALUE FROM CHART BY One - CLICK in EXCEL- MACRO

    yes! I change sheet1 to "Learn". and the error appears.
    I search google in 3 hours and I know that I have to change lines
    Set gChtEvt.OutputToCell_X = Sheets("Learn")..Range("A1")
    Set gChtEvt.OutputToCell_Y = Sheets("Learn")..Range("B1")
    Set gChtEvt.OutputToCell_Name = Sheets("Learn")..Range("C1")
    yeah. And it works again :D. Thanks a lot Andy. So Cooooool :D

+ 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. Excel chart point textbox for every point
    By dorabajji in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2020, 02:59 AM
  2. VBA to export excel charts as bitmaps into Power Point
    By marcinpec in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2018, 11:39 AM
  3. Help Needed : Macro to click on "Export to excel" tab
    By Elangovan89 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-24-2014, 07:35 AM
  4. Replies: 3
    Last Post: 01-11-2013, 08:08 AM
  5. how do i export a graph from excel to power point?
    By lisajensen21 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-14-2006, 10:50 PM
  6. [SOLVED] In Excel, how do I create a point and click icon?
    By Marauder1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2006, 02:10 PM
  7. [SOLVED] click data point in chart and delete
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-07-2005, 06:05 AM

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