Thread: Tally Sheet
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Tally Sheet

Change
If Target.Address = "$E$4" Then

to
if Not Intersect(Target, Range("E1:E100,F5,G10:H20")) is nothing then


--
Regards,
Tom Ogilvy

"RICK ROBERSON" wrote in message
...
I think it will help a lot. One more question as to how I would change

that
to more then on cell or a certain range of cells

--
Rick Roberson
University of Phoenix Online


360 578-4695 (work)
360 423-7181 (home)
360 423-6571 (fax)
Pacific Time
"zantor " wrote in message
...
Here is one way, but not the most elegant...

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

In a new workbook insert the following code under "Sheet1" in the
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/