Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Leo Leo is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable mouse clicks on a range of cells with validations GarySD Excel Discussion (Misc queries) 1 January 27th 10 02:00 PM
Counting clicks rengewwj[_2_] Excel Discussion (Misc queries) 5 December 23rd 08 08:14 PM
Repetitive keystrokes and/or mouse clicks Lydia Ferguison Excel Discussion (Misc queries) 1 August 8th 08 07:00 PM
Double clicks do not open the file Aggie Excel Discussion (Misc queries) 1 November 12th 07 10:42 AM
How do I alter plot area colour in a chart without a mouse? debbiecatal Charts and Charting in Excel 2 May 30th 05 04:11 AM


All times are GMT +1. The time now is 05:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"