ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run some code on a left click (https://www.excelbanter.com/excel-programming/324416-run-some-code-left-click.html)

cdb

Run some code on a left click
 
I have some code that I have managed to get to run when you right click in a
certain range of cells using the Worksheet_BeforeRightClick option. Is there
anyway of getting some code to work in the same range when there is a left
click??

Harald Staff

Run some code on a left click
 
Not that I know of, leftclick is used by the worksheet itself to decide
where you want to go to.
You could put a transparent object from the drawing toolbar over the range
and assign the code to it perhaps ? I do that a lot.

HTH. Best wishes Harald

"cdb" skrev i melding
...
I have some code that I have managed to get to run when you right click in

a
certain range of cells using the Worksheet_BeforeRightClick option. Is

there
anyway of getting some code to work in the same range when there is a left
click??




Bob

Run some code on a left click
 
How about using BeforeDoubleClick? This would run your code every time the
left mouse button is double clicked.

"cdb" wrote:

I have some code that I have managed to get to run when you right click in a
certain range of cells using the Worksheet_BeforeRightClick option. Is there
anyway of getting some code to work in the same range when there is a left
click??


cdb

Run some code on a left click
 
I think that's the way I'll have to go - got so caught up in trying to do it
with one click I forgot all about that!!

"Bob" wrote:

How about using BeforeDoubleClick? This would run your code every time the
left mouse button is double clicked.

"cdb" wrote:

I have some code that I have managed to get to run when you right click in a
certain range of cells using the Worksheet_BeforeRightClick option. Is there
anyway of getting some code to work in the same range when there is a left
click??


cdb

Run some code on a left click
 
Cheers for the suggestion

"Harald Staff" wrote:

Not that I know of, leftclick is used by the worksheet itself to decide
where you want to go to.
You could put a transparent object from the drawing toolbar over the range
and assign the code to it perhaps ? I do that a lot.

HTH. Best wishes Harald

"cdb" skrev i melding
...
I have some code that I have managed to get to run when you right click in

a
certain range of cells using the Worksheet_BeforeRightClick option. Is

there
anyway of getting some code to work in the same range when there is a left
click??





Mark Schreiber

Run some code on a left click
 
I would be interested in how you set up code to run on the right click event
when a certain range is activated. I am trying to set up a spreadsheet so
that when any of a particular group of cells is activated, the contents and
formatting of that cell change. Basically, toggling back and forth between
TRUE and FALSE like a check box. However, because the spreadsheet is very
wide, I am using Group & Outline to condense it. When I tried to do this
using standard check boxes, I found that the check boxes do not stick in
place in the cells where I put them, when I collapse the group. So am trying
to make the actual cell do the job. Any ideas?

Mark Schreiber

"cdb" wrote:

I think that's the way I'll have to go - got so caught up in trying to do it
with one click I forgot all about that!!

"Bob" wrote:

How about using BeforeDoubleClick? This would run your code every time the
left mouse button is double clicked.

"cdb" wrote:

I have some code that I have managed to get to run when you right click in a
certain range of cells using the Worksheet_BeforeRightClick option. Is there
anyway of getting some code to work in the same range when there is a left
click??



All times are GMT +1. The time now is 03:02 AM.

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