Looking for a function that will add value to another cell

K

ktjohn

Basically I am trying to check for the value of one cell and if it is true
then add/subtract one from another cell.

if A1 is "true" then B1 equals B1+1

Any ideas?

Thanks
 
J

JulieD

Hi

because this a circular reference you have two choices, you can tick the
Interation check box in tools / options / calculations tab (and set the max
to 1) (i don't know the full implications of doing this) or you can use code
e.g.

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Range("A1") = True Then
Range("B1") = Range("B1") + 1
End If
Application.EnableEvents = True
End Sub

- to use this code, right mouse click on the sheet tab where you want the
code and choose view code
copy & paste the code there

Cheers
julieD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top