Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Plot where mouse clicks
I am trying to write some VBA code that will allow me to plot a
point/shape on a graph whereve I click my mouse. It must do this on the first click on the active chart. I have used a MouseDown event to get x nad y coordinates but when I place a shape at this (x,y) coordinate it does not appear at the point where i clicked my mouse. The offset does not seem to be a constant value. Can somebody please help me with this or advise me on another aproach to reach my objective? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Plot where mouse clicks
I think it is the old story where you have got so far and need mor information for the next step. I have done some work with this - mainly getting data from extrna applictions. I think that, where you are at the moment, you have d recognise that mouse co-ordinates can relate to the full monitor scree or the active window, and Excel VBA co-ordinates probably relate t neither. I remember somewhere seeing some calculations to convert mous pixel co-ordinates to "mickeys". I remember getting problems if th user did not have the application window maximised - when it could b any size. Here isa bit of Excel code, which I see relates screen co-ordinates 0, to the top left of cell A1. The Height is the same as Row Height bu Width is NOT the same as Cell Width. '--------------------------------------------------------------------------- Sub GET_CELL_POSITION() ActiveCell.Offset(0, 1).Value = ActiveCell.Address & " Top : " ActiveCell.Top & " Points." ActiveCell.Offset(1, 1).Value = ActiveCell.Address & " Left : " ActiveCell.Left & " Points." ActiveCell.Offset(2, 1).Value = ActiveCell.Address & " Height : " ActiveCell.Height & " Points." ActiveCell.Offset(3, 1).Value = ActiveCell.Address & " Width : " ActiveCell.Width & " Points." End Sub '------------------------------------------------------------------------- ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Disable mouse clicks on a range of cells with validations | Excel Discussion (Misc queries) | |||
Counting clicks | Excel Discussion (Misc queries) | |||
Repetitive keystrokes and/or mouse clicks | Excel Discussion (Misc queries) | |||
Double clicks do not open the file | Excel Discussion (Misc queries) | |||
How do I alter plot area colour in a chart without a mouse? | Charts and Charting in Excel |