Okay I am just starting out with VBA and I'm lost. So I have a single cell that has the following formulas =IF(Car_Weight>=70,"Yes",""). I need a counter that counts up only the amount of times the cell reads "Yes". This counter would also need a reset to 0 button. Not sure if this enough info enable someone to help. I've tried the following VBA code but it counts every switch between "yes" and "".
This is my first post on here and first time reaching out for help like this. Thank you all in advance
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("B9") Then
xCount = xCount + 1
Range("C9").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("C9").Value = xCount
End If
Application.EnableEvents = True
End Sub
This is my first post on here and first time reaching out for help like this. Thank you all in advance