View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Add 1 to cell when another cell changes

Right-click the sheet tab and choose "View Code". In that module, paste the
following code:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrH
If (Target.Address = Range("B1").Address) Or _
(Target.Address = Range("C1").Address) Then
Application.EnableEvents = False
Range("A1").Value = Range("A1").Value + 1
End If
ErrH:
Application.EnableEvents = True
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"Maddoktor" wrote in message
...
How do I add 1 to cell "A1" if cell "B1" or "C1" changes?