+ Reply to Thread
Results 1 to 7 of 7

Using mouse/userform to move a point on a scatter chart

  1. #1
    Registered User
    Join Date
    07-07-2016
    Location
    Kuwait
    MS-Off Ver
    2016
    Posts
    28

    Using mouse/userform to move a point on a scatter chart

    I have an embedded scatter chart of a grid of X,Y coordinates and am wondering if I can use the mouse to click on any point and then move it a small distance to a new X,Y position (i.e. updating the columns of X,Y values in real time). At the moment I have some code I downloaded (pasted below), and modified with help from this forum, that I can use to write out the X,Y values of points that are clicked on.

    Here is the simplest solution I can think of:
    1) use mouse to click on chart point and get X,Y values (already done)
    2) have a userform pop up that allows me to enter new X and Y values with the keyboard
    3) replace the original X,Y values in the worksheet with the new values, and see the change on the chart
    4) repeat for other points

    Any help (code outline) would be appreciated.

    Thanks,

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Karlstad, Sweden
    MS-Off Ver
    Excel 2016
    Posts
    232

    Re: Using mouse/userform to move a point on a scatter chart

    I have attached and example in a workbook. Hope this can be helpful.
    Attached Files Attached Files
    1. Reply to thread and inform if suggestion was helpful or not
    2. Click on the star (=Add Reputation) if you think someone helped you
    3. Mark [SOLVED] to this thread if solution was found. (On Menu "Thread Tools" > "Mark this thread as solved")

  3. #3
    Registered User
    Join Date
    07-07-2016
    Location
    Kuwait
    MS-Off Ver
    2016
    Posts
    28

    Re: Using mouse/userform to move a point on a scatter chart

    Hi Joakim,

    Thanks for the example. I tried running on my workbook and I get an error 9 when running. Do you know what is going wrong? The code is selecting the right range for the X,Y values (columns A and B, rows 3 to 846)

    Untitled.png

  4. #4
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Karlstad, Sweden
    MS-Off Ver
    Excel 2016
    Posts
    232

    Re: Using mouse/userform to move a point on a scatter chart

    Hi,
    It's difficult to provide help if you don't attach your workbook.

  5. #5
    Registered User
    Join Date
    07-07-2016
    Location
    Kuwait
    MS-Off Ver
    2016
    Posts
    28

    Re: Using mouse/userform to move a point on a scatter chart

    Hi,

    Example workbook is attached.

    Thanks,
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    04-24-2012
    Location
    Karlstad, Sweden
    MS-Off Ver
    Excel 2016
    Posts
    232

    Re: Using mouse/userform to move a point on a scatter chart

    Hi,

    It seems that it doesn't accept your worksheet name "AB-1234 10m5m". I changed to "Test". Then it worked. Space is not allowed as character. Then VBA code has to be modified to take care of that. It seems that "-" wasn't accepted either. I tested "AB_1234_10m5m". It worked.

  7. #7
    Registered User
    Join Date
    07-07-2016
    Location
    Kuwait
    MS-Off Ver
    2016
    Posts
    28

    Re: Using mouse/userform to move a point on a scatter chart

    Hi,

    Yes, it works fine with new name. Great - thanks for your help!

+ 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. Can a macro record a point on a XY Scatter Chart
    By stanleydgromjr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2010, 07:51 PM
  2. Add custom tool tip to a Point in Scatter chart using VBA
    By abiram01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2006, 08:35 AM
  3. [SOLVED] How do I change one point in a scatter chart color
    By Ed in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-30-2006, 10:50 AM
  4. Scatter Chart Data Point Highlighting
    By rvExcelNewTip in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 01-08-2006, 01:21 PM
  5. Data point labels in XY scatter chart
    By TonyGB007 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-09-2005, 05:20 AM
  6. [SOLVED] Scatter Chart with point labels
    By Jim in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2005, 08:40 PM
  7. [SOLVED] How to get x,y coordinates of point from scatter chart in VBA
    By Milo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2005, 08:25 PM
  8. clicking on a point in a scatter chart
    By SD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2005, 11: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