Forum Discussion
How to stop excel from updating dates.
macros are acceptable, but i am not well versed so i would need a step by step to replicate.
Right-click the sheet tab.
Select 'View Code' from the context menu.
Copy the code listed below into the worksheet module.
Switch back to Excel.
Save the workbook as a macro-enabled workbook (*.xlsm).
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim cel As Range
Set rng = Intersect(Range("G2:G" & Rows.Count), Target)
If Not rng Is Nothing Then
Application.ScreenUpdating = False
Application.EnableEvents = False
For Each cel In rng
If cel.Value = False Then
cel.Offset(0, 1).ClearContents
Else
cel.Offset(0, 1).Value = Date
End If
Next cel
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
- Evoss87Feb 14, 2025Copper Contributor
Thank you, now how can i do that in multiple columns for different vendors?
IE: column G, O, W, AE, AM, AU,BC,BK, BS,CA are all check boxes. then H, P, X, AF, AN, AT, BL, BT, and CB are all dates.
- HansVogelaarFeb 14, 2025MVP
Change
Set rng = Intersect(Range("G2:G" & Rows.Count), Target)
to
Set rng = Intersect(Range("G2:G" & Rows.Count & ",O2:O" & Rows.Count & ",W2:W" & Rows.Count & ",AE2:AE" & Rows.Count & ",AM2:AM" & Rows.Count & ",AU2:AU" & Rows.Count & ",BC2:BC" & Rows.Count & ",BK2:BK" & Rows.Count & ",BS2:BS" & Rows.Count & ",CA2:CA" & Rows.Count & ",O2:O" & Rows.Count), Target)
- Evoss87Feb 18, 2025Copper Contributor
thank you. i had to modify the column numbers a little but all is working well! thank you verymuch
- Evoss87Feb 14, 2025Copper Contributor
example: