#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Tally Sheet

I need to build up a tally sheet for tracking some maintenance frequencies, so as I am going through a large stack of these different procedures I want to be able to click on the appropriate cell and have it increment up one with the left mouse button or down with the right mouse button.I have Excel2003 and I have been trying to figure out how to make it happen with VBA and a custom function but it seems to be all set up for forms and I would like to make this happen right on the worksheet. I would really appreciate a pointer that could steer me in the right direction.

--
Rick Roberson

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Tally Sheet

Here is one way, but not the most elegant...

The following code will increase the value in "E4" by one if you doubl
click that cell with the left button. The value will decrease if yo
right-click on that cell. (Excel 97)

In a new workbook insert the following code under "Sheet1" in th
VBA-Project window (Do not insert it in a module it will not work!)

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range
Cancel As Boolean)
If Target.Address = "$E$4" Then
Cells(4, 5) = Cells(4, 5) + 1
End If
Cells(5, 5).Select
End Sub

Private Sub Worksheet_BeforeRightClick(ByVal Target As Excel.Range
Cancel As Boolean)
If Target.Address = "$E$4" Then
Cells(4, 5) = Cells(4, 5) - 1
End If
End Sub

Hope this helps..

--
Message posted from http://www.ExcelForum.com

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
I want to tally my sheet Mr. Haney Excel Worksheet Functions 6 April 23rd 09 12:24 AM
how do I create a tally sheet Cathi Excel Discussion (Misc queries) 0 October 16th 06 05:18 PM
By selecting cells adjacent to cells tally sheet tom Excel Worksheet Functions 2 September 20th 06 07:09 PM
create tally sheet for positions- insert names and tally # tally sheets Excel Discussion (Misc queries) 0 April 11th 06 09:41 PM
Tally occurences of phrase on one sheet. RYD@wolpofflaw Excel Discussion (Misc queries) 1 November 18th 05 09:09 PM


All times are GMT +1. The time now is 02:58 AM.

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"