Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default add 1 to a sum by clicking mouse?

In Excel, can 1 be added to the sum by clicking once in a cell? For
instacne, if I click once in a cell correspong to the cell that displays the
sum of a row, one will be added. Each time I click the mouse, 1 is added to
the total? Just like a small hand held clicker.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default add 1 to a sum by clicking mouse?

right click sheet tabview codeinsert thissave. Now when you just select
cell a5 1 will be added to the sum.


Option Explicit
Dim oldvalue As Double
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$5" Or Target.Address = "$B$5" Then
Application.EnableEvents = False
If Target.Value = 0 Then oldvalue = 0
Target.Value = 1 + oldvalue
oldvalue = Target.Value
Application.EnableEvents = True
End If
End Sub
Sub fixit()
Application.EnableEvents = True
End Sub


--
Don Guillett
SalesAid Software

"muzic247" wrote in message
...
In Excel, can 1 be added to the sum by clicking once in a cell? For
instacne, if I click once in a cell correspong to the cell that displays
the
sum of a row, one will be added. Each time I click the mouse, 1 is added
to
the total? Just like a small hand held clicker.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default add 1 to a sum by clicking mouse?

Nope. There's nothing that fires when you click on a cell.

But maybe you could tie into the _beforedoubleclick and _beforerightclick
events:

If you want to try, rightclick on the worksheet tab that should have this
behavior. Select view code and paste this into the code window:

Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub

Cancel = True 'stop editing in cell
If IsNumeric(Target.Value) Then
Target.Value = Target.Value + 1
End If
End Sub

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _
Cancel As Boolean)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub

Cancel = True 'stop pop up from showing
If IsNumeric(Target.Value) Then
Target.Value = Target.Value - 1
End If
End Sub

I used any cell in Column A. You can change that in both spots if you want.
Doublclicking will add 1. Rightclicking will subtract 1.

muzic247 wrote:

In Excel, can 1 be added to the sum by clicking once in a cell? For
instacne, if I click once in a cell correspong to the cell that displays the
sum of a row, one will be added. Each time I click the mouse, 1 is added to
the total? Just like a small hand held clicker.


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default add 1 to a sum by clicking mouse?

How about adding a Spinner from the Forms Toolbar

You can click to add or click to reduce.


Gord Dibben MS Excel MVP

On Tue, 15 Aug 2006 14:48:01 -0700, muzic247
wrote:

In Excel, can 1 be added to the sum by clicking once in a cell? For
instacne, if I click once in a cell correspong to the cell that displays the
sum of a row, one will be added. Each time I click the mouse, 1 is added to
the total? Just like a small hand held clicker.


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
Mouse pointer becomes hyperlink when sheet protected GillianHG Excel Discussion (Misc queries) 0 September 28th 05 03:30 PM
HELP: Mouse Pointer Changes When Sheet Protected GillianHG Excel Discussion (Misc queries) 2 September 23rd 05 07:42 PM
Is clicking on the tab with my mouse the only way to move from on. Elizabeth Excel Worksheet Functions 2 March 21st 05 06:43 PM
Mouse continues to select after clicking on a cell in excel. Fletch Excel Discussion (Misc queries) 4 February 22nd 05 02:27 AM
moving mouse highlights cells. why? brentb Excel Discussion (Misc queries) 1 January 17th 05 05:34 PM


All times are GMT +1. The time now is 09:09 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"