Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to write a macro to count clicks in Excel?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to write a macro to count clicks in Excel?
Rightclick on the worksheet tab that should have this behavior and select view
code. Paste this into the code window: Option Explicit Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _ Cancel As Boolean) If Target.Cells.Count 1 Then Exit Sub If Intersect(Target, Me.Range("a1")) Is Nothing Then Exit Sub Cancel = True With Target.Offset(0, 1) If IsNumeric(.Value) Then .Value = .Value + 1 Else Beep End If End With End Sub If you rightclick on A1, it'll add 1 to B1. (You could use Worksheet_BeforeDoubleClick, too. But there isn't a single click event.) GoBoilerzz wrote: Hello....I would like to write a macro/formula in Excel such that each click in a cell will add 1 to another cell, ie the number of clicks will be counted. It can be either a left or right click....Is this possible?? Thanks!! Steve -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count and Reset Button Clicks | Excel Discussion (Misc queries) | |||
How to write a macro to count dates | Excel Worksheet Functions | |||
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? | Excel Worksheet Functions | |||
How to write a macro to get the system time in excel 97 | Excel Discussion (Misc queries) | |||
How do I write a conditional statement in Excel to count if two c. | Excel Worksheet Functions |