April 9, 2024
Contribute to the Microsoft 365 and Office forum!
Click here to learn more 💡
May 10, 2024
Excel Forum Top Contributors:
Count the number of times a cell is changed for multiple cells
Report abuse
Thank you.
Reported content has been submitted
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
What is the revised code supposed to do differently?
I get that i could manually manipulate the counter but ideally when this is working the counter would be invisible to someone using the spreadsheet. They will just update the date and if they make a mistake entering the date they won't know why the counter is off.
If there a way to do this so that it only updates the counter after the worksheet is saved or closed?
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
OK, so I think we're almost there. The problem now is that AB is never changing to collect the new date so whether I physically change the date in G or not once it's changed it's always registering an unmatched value because AB is never updated with the new date.
I tried to add a line to make the date in AB update but it's not working so I assume my syntax is wrong.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim MyWorksheet As Worksheet
Dim Cell As Range
Set MyWorksheet = ThisWorkbook.Worksheets("Sheet1")
For Each Cell In MyWorksheet.Range("G2:G" & MyWorksheet.Range("G" & Rows.Count).End(xlUp).Row)
If Cell.Value <> Cell.Offset(0, 21).Value Then
Cell.Offset(0, 20).Value = Cell.Offset(0, 20).Value + 1
Cell.Offset(0, 21).Value = Cell.Value
End If
Next Cell
End Sub
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Dim Cell As Range
Set MyWorksheet = ThisWorkbook.Worksheets("Sheet1")
For Each Cell In MyWorksheet.Range("G2:G" & MyWorksheet.Range("G" & Rows.Count).End(xlUp).Row)
If Cell.Value <> Cell.Offset(0, 21).Value Then
Cell.Offset(0, 20).Value = Cell.Offset(0, 20).Value + 1
Cell.Offset(0, 21).Value = Cell.Value
End If
Next Cell
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Question Info
Last updated March 23, 2024 Views 2,913 Applies to: