Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Counting Clicks
This may be a trivial problem, but it has me slightly bugged. Is it
possible to count the number of times an Excel cell has been clicked on? What I have in mind is, for example, an array of cells from A1 to I10, and a corresponding array from A11 to I21. The idea is that if a cell in the upper array is clicked, the corresponding cell in the lower array is increased by one. Thus if C3 is clicked, C13 would by incremented. Is such a thing possible and if so, how? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Counting Clicks
Unless you look at the actual mouse-clicks with the
Windows API, this is the best I can come up with: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim lScrollRow As Long Dim lScrollColumn As Long Dim lTargetRow As Long Dim lTargetColumn As Long If Target.Row 10 Or Target.Column 10 Then Exit Sub End If Application.ScreenUpdating = False lScrollRow = ActiveWindow.ScrollRow lScrollColumn = ActiveWindow.ScrollColumn lTargetRow = Target.Row lTargetColumn = Target.Column Cells(lTargetRow + 10, lTargetColumn) = _ Cells(lTargetRow + 10, lTargetColumn) + 1 Cells(65536, 256).Select ActiveWindow.ScrollRow = lScrollRow ActiveWindow.ScrollColumn = lScrollColumn Application.ScreenUpdating = True End Sub Put this in the worksheet code. It will be simpler if you could do it with a right mouse-click as there is the Worksheet_BeforeRightClick event. RBS wrote in message ... This may be a trivial problem, but it has me slightly bugged. Is it possible to count the number of times an Excel cell has been clicked on? What I have in mind is, for example, an array of cells from A1 to I10, and a corresponding array from A11 to I21. The idea is that if a cell in the upper array is clicked, the corresponding cell in the lower array is increased by one. Thus if C3 is clicked, C13 would by incremented. Is such a thing possible and if so, how? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Counting Clicks
On Sun, 9 Jul 2006 17:09:40 +0100, "RB Smissaert"
wrote: Unless you look at the actual mouse-clicks with the Windows API, this is the best I can come up with: Rest snipped Thanks very much. I'll give it a try |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Counting clicks | Excel Discussion (Misc queries) | |||
Why 2 clicks on a command button | Excel Programming | |||
Clearing TextBoxes needs 2 clicks | Excel Programming | |||
A VBA code that clicks a checkbox | Excel Programming | |||
Plot where mouse clicks | Excel Programming |