Forum Discussion
DianaRato
Jun 25, 2021Copper Contributor
Count every time a new value is entered in a Cell
Hello all, I hope I am able to explain what I want to do properly, so here it goes: I have two cells that I want to count the values of, but the second cell is constantly being updated with a...
- Jun 25, 2021
Hello DianaRato,
Enter this VBA code as a procedure in the necessary worksheet:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Sheets("Sheet1").Range("A1"), Target) Is Nothing Then
Range("B1").Value = Range("B1").Value + 1
End If
End SubWhere...
- "Sheet1" is the sheet that you want to reference
- Range("A1") is the range of cells that you want to check for changes
- Range("B1") is the cell that will add one for each change that is made in the range of cells that you want to check for changes
DianaRato
Jun 25, 2021Copper Contributor
Hi Sergei,
Here is a video, in the third cell I want to appear 3 for the total number of values that were put in those cells.
https://www.loom.com/share/85e7528b1d7142f988b45218b82244a5
Here is a video, in the third cell I want to appear 3 for the total number of values that were put in those cells.
https://www.loom.com/share/85e7528b1d7142f988b45218b82244a5
PReagan
Jun 25, 2021Bronze Contributor
Hello DianaRato,
Enter this VBA code as a procedure in the necessary worksheet:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Sheets("Sheet1").Range("A1"), Target) Is Nothing Then
Range("B1").Value = Range("B1").Value + 1
End If
End Sub
Where...
- "Sheet1" is the sheet that you want to reference
- Range("A1") is the range of cells that you want to check for changes
- Range("B1") is the cell that will add one for each change that is made in the range of cells that you want to check for changes