+ Reply to Thread
Results 1 to 7 of 7

VBA Scatterplot Data Labels

  1. #1
    Registered User
    Join Date
    03-26-2014
    Location
    Washington
    MS-Off Ver
    Excel 2010
    Posts
    61

    VBA Scatterplot Data Labels

    I have the table of data listed below with column 2 as my x-axis and column 3 as my y-axis. I would like to have a macro that will only show the label for the 3rd row in the table (in this case it would only show the data label for the point that matches to Jane). What would the vba code be to make that happen? Thanks.

    Please Login or Register  to view this content.

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

    Re: VBA Scatterplot Data Labels

    Do you really need code? If you add another series that only displays required data labels you can control it all via worksheet.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-26-2014
    Location
    Washington
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: VBA Scatterplot Data Labels

    Thanks! I didn't even think of that. I put that in and ran it however it only labels the point with the y value and not the person's name which is what I want. How would I change that?

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

    Re: VBA Scatterplot Data Labels

    The only built in information displayed in the data label is Series Name, X and Y value.
    So unless you have set each data point as a series you can not simply apply data labels. You would need to determine which cell contained the information and then set the text in the data label.

    If it is only 1 label then the additional series approach allows you to use the Series Name in the data label.

  5. #5
    Registered User
    Join Date
    03-26-2014
    Location
    Washington
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: VBA Scatterplot Data Labels

    So if I were to say that I would always like to label Point(3) with the person's name if I click a button only and with the person's name being stored in cell A20 on the active sheet how would I be able to do that? I can currently show all points using the code below but I need the option of only showing one when necessary.

    Please Login or Register  to view this content.

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

    Re: VBA Scatterplot Data Labels

    untested but something like
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-26-2014
    Location
    Washington
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: VBA Scatterplot Data Labels

    Nice! Thanks Andy!. This is the first jump into working with charts in vba so lots to learn. I can tweak that now to what I need.

+ 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. Hover labels on scatterplot points
    By rgonzrubio in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-17-2021, 01:35 PM
  2. How to add labels to a scatterplot
    By SEMMatt in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-31-2014, 01:18 PM
  3. [SOLVED] Scatterplot data points
    By allisonnp36 in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 12-13-2013, 04:31 PM
  4. Scatterplot Labels
    By thumper300zx in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-12-2009, 01:26 PM
  5. Scatterplot axis labels
    By mjamromi in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-25-2005, 12:45 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