Excel Tips - Insert Current Date and Time

Excel Tips - Insert Current Date and Time

The best way to insert the?current date and time?is to use?the NOW function?which takes the date and time from the system and returns it.

No alt text provided for this image

The only problem with this function is it’s volatile,?and whenever you recalculate something it updates its value. And if you don’t want to do this,?the best way is to?convert it to hard value.

You can also use the below?VBA code ;

Sub timestamp(
Dim ts As Date
With Selection
.Value = Now
.NumberFormat = "m/d/yyyy h:mm:ss AM/PM"
End With
End Sub)        

#excel #exceltips #businessanalytics #exceltutorial #vbaexcel

From Excel Champs

要查看或添加评论,请登录

社区洞察

其他会员也浏览了