Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
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
Counting clicks rengewwj[_2_] Excel Discussion (Misc queries) 5 December 23rd 08 08:14 PM
Why 2 clicks on a command button cush Excel Programming 2 May 10th 05 07:16 PM
Clearing TextBoxes needs 2 clicks Ken McLennan[_3_] Excel Programming 8 September 2nd 04 01:53 PM
A VBA code that clicks a checkbox nevaspb Excel Programming 2 August 19th 04 03:55 AM
Plot where mouse clicks Leo Excel Programming 1 November 14th 03 02:50 PM


All times are GMT +1. The time now is 05:59 PM.

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"