1. I would like to trigger an event once i click on a cell, for example I click one click on a cell (1,1) and it run some macro.
2. When I bring my cursor to this cell , to change cursor pointer to pointer like in hyperlink.
Thanks
1. I would like to trigger an event once i click on a cell, for example I click one click on a cell (1,1) and it run some macro.
2. When I bring my cursor to this cell , to change cursor pointer to pointer like in hyperlink.
Thanks
Re: Click On Cell Event
Jonny,
There will not be a way to change the mouse pointer just by moving the mouse over a cell. There is no mouse_Move event for a worksheet.
However, once you select a cell you can use the "Cursor Property" to change the cursor however there are only 4 options that you can change it to, and then it won't change back until you select another cell. So changing the curor IMHO will not be a good idea.
As far as running code when a cell is selected. Use the:
Re: Click On Cell Event
iwrk4dedpr, thank you.
It looks really easy
Re: Click On Cell Event
That's fine, but what if I want to detect WHICH cell has been clicked - obviously I don't want to specify the whole worksheet...
Re: Click On Cell Event
Quote from PaulBiThat's fine, but what if I want to detect WHICH cell has been clicked - obviously I don't want to specify the whole worksheet...
As displayed in the Code tag above you can specifiy your actions for a given cell by using an If funtion on the Target.Row or Target.Column criteria.
Note that the above code tag executes code when cell(1,1) is selected.
Hope this helps
Re: Click On Cell Event
Numerous ways to isolate a target range!! Examples:
If Target.Column <> 2 Then Exit Sub ' Limits Target range to column 2
If Target.Row <3 Then Exit Sub ' Limits Target range to rows 3 and below
If Intersect(Target, Range("$D$2:$F$10") Is Nothing Then Exit Sub ' Limits range to D2:F10
If Intersect(Target,Range("myRange")) Is Nothing Then Exit Sub 'Limits range to a named range (my Range)
Just a few of the many techniques available
lenze
Don’t have an account yet? Register yourself now and be a part of our community!