Add Value To Cell

colinh

Board Regular
Joined
Dec 2, 2010
Messages
60
Hi All,
I have a cell O8 with a value of zero. I also have a cell with nothing in it R8. How to I for instance add any plus (i.e. more than zero) value to cell R8 and cell O8 automatically increments to 1. If I add a bit more to R8 than O8 increments to 2, add a bit more and O8 becomes 3 and so on. What I add to R8 each time will be a random number.

Thanks for your help

Colin.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
More info needed. Are you wanting O8 to change ONLY in increments of 1 no matter what number is entered in R8? Are you adding whole numbers? Could you give an example of what you are wanting?

O8 = 0 R8 = blank
O8 = 1 R8 = 5
O8 = 2 R8 = 7

So you want it to be a counter of editing rather than a mathematical issue?
 
Upvote 0
Hi
Yes please increments of 1 whatever number is entered into R8 and whole numbers. A counter will be just the job.

Colin
 
Upvote 0
VBA code:

Dim xCount As Integer

Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRg As Range, xCell As Range
On Error Resume Next
If Target = Range("R8") Then
xCount = xCount + 1
Range("O8").Value = xCount
End If
Application.EnableEvents = False
Set xRg = Application.Intersect(Target.Dependents, Me.Range("B9"))
If Not xRg Is Nothing Then
xCount = xCount + 1
Range("O8").Value = xCount
End If
Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,617
Messages
6,120,541
Members
448,970
Latest member
kennimack

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top