"Excel - Get Date"
If you want the current data in a cell, simply type =TODAY() in it. BUT: As this is a formula, the data will automatically change whenever the workbook is recalculated
If you want the data inserted only when the user enters that particular cell
Use this code: it must be in the Sheet
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range
If Not Application.Intersect(Target, Range("A5")) Is Nothing The
Range("A5") = Dat
End I
End Su
NOTE: just usiing Date ensures that the current date is shown in the date format found in Regional Settings on your PC.
|