swapnilpradhan2688
New Member
- Joined
- Jun 7, 2020
- Messages
- 18
- Office Version
- 2013
- Platform
- Windows
- Mobile
- Web
I want to stop auto-updating date the next day. I used today() function but it is not helping.
thank you
thank you
roll no | name | date |
1 | xyz | 28/06/2020 |
2 | abc | 28/06/2020 |
roll no | name | date |
1 | xyz | 28/06/2020 |
2 | abc | 28/06/2020 |
3 | def | 29/06/2020 |
You can't do that with a formula.I want to stop auto-updating date the next day. I used today() function but it is not helping.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Changed As Range, rw As Range
Dim Date_Val As Variant
Set Changed = Intersect(Target, Columns("A:B"), Rows("2:" & Rows.Count))
If Not Changed Is Nothing Then
Application.EnableEvents = False
For Each rw In Changed.EntireRow.Resize(, 2).Rows
If Len(rw.Cells(1).Value & rw.Cells(2).Value) > 0 Then
Date_Val = Date
Else
Date_Val = ""
End If
Range("C" & rw.Row).Value = Date_Val
Next rw
Application.EnableEvents = True
End If
End Sub