ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Mouse Up or Down Event (https://www.excelbanter.com/excel-discussion-misc-queries/149035-mouse-up-down-event.html)

billinr

Mouse Up or Down Event
 
I have a good code to capture and extract data from a chart using a MouseUp
event (Thanks to Jon Peltier) - now I would like to push my luck and ask for
additional help.
My current code allows me to capture an "X" value and paste it into another
analysis area. I would like to be able to capture a second value; can I set
something up to capture the second value with a right click or maybe a
Ctrl-click?
The user would then click a second time to get the second value.

Is this possible?

Thanks for the help.

Jon Peltier

Mouse Up or Down Event
 
You could use the same even procedure, and make it smart enough to know the
first value has been selected so it adds the new value to a different cell.

Or you can put the value into a different cell based on the button that was
clicked. The procedure starts with this line:

Private Sub Chart_MouseUp(ByVal Button As Long, ByVal Shift As Long, _
ByVal x As Long, ByVal y As Long)
Use something like this to direct the output: Select Case Button Case
xlPrimaryButton ' left click ' save in first cell Case
xlSecondaryButton ' right click ' save in second cell End Select

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"billinr" wrote in message
...
I have a good code to capture and extract data from a chart using a MouseUp
event (Thanks to Jon Peltier) - now I would like to push my luck and ask
for
additional help.
My current code allows me to capture an "X" value and paste it into
another
analysis area. I would like to be able to capture a second value; can I
set
something up to capture the second value with a right click or maybe a
Ctrl-click?
The user would then click a second time to get the second value.

Is this possible?

Thanks for the help.




billinr

Mouse Up or Down Event
 
Thanks yet again for your help, Jon.
That solution is just what the boss wanted.

"Jon Peltier" wrote:

You could use the same even procedure, and make it smart enough to know the
first value has been selected so it adds the new value to a different cell.

Or you can put the value into a different cell based on the button that was
clicked. The procedure starts with this line:

Private Sub Chart_MouseUp(ByVal Button As Long, ByVal Shift As Long, _
ByVal x As Long, ByVal y As Long)
Use something like this to direct the output: Select Case Button Case
xlPrimaryButton ' left click ' save in first cell Case
xlSecondaryButton ' right click ' save in second cell End Select

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"billinr" wrote in message
...
I have a good code to capture and extract data from a chart using a MouseUp
event (Thanks to Jon Peltier) - now I would like to push my luck and ask
for
additional help.
My current code allows me to capture an "X" value and paste it into
another
analysis area. I would like to be able to capture a second value; can I
set
something up to capture the second value with a right click or maybe a
Ctrl-click?
The user would then click a second time to get the second value.

Is this possible?

Thanks for the help.






All times are GMT +1. The time now is 11:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com