Maybe I should explain this a little better. This is for an invoice sheet with multiple lines on it so there are multiple dates. I thought I would need to know how to reference the date column using vba so I could reference the current cell that has the date entered. How would I do this?
Here is the code:
Sub worksheet_change(ByVal target As Range)
Dim cell As Range
Application.EnableEvents = False
If Range("A1").Value < Date Then
MsgBox "This input is older than today !....Are you sure that is what you want ???"
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified 9/4/2018 10:05:48 PM EDT
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.EnableEvents = False
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Value < Date Then
ans = MsgBox("This input is older than today !....Are you sure that is what you want ???", vbYesNo)
If ans = vbNo Then Target.Value = ""
End If
End If
Application.EnableEvents = True
End Sub
Thanks, that is perfect!!!
Sub Reset_Me()
Application.EnableEvents = True
End Sub