VBA code to autopost date and time stamp

NextGen

New Member
Joined
Jun 6, 2013
Messages
1
I'm trying to create VBA code or a Macro that will autopost date & time stamping if a cell is populated but will leave the cell blank if it is not populated.

For instance if A5 has date entered into it I want A6 to have the date time stamp in it. Yes it would require the cell under for this instance. I have 5 days so I would need A6 to populate if A5 is entered and then B6 to populate if B5 is entered and so on for C, D, and E.

I have searched the web and have found lots of codes but none that can accomplish what I want.

Would appreciate any help I can get! Thanks in advance!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hello and welcome to the Board

See if this is what you want:

Code:
' this goes at the sheet module


Private Sub Worksheet_Change(ByVal Target As Range)
' monitors only range A5:E5


If Not Intersect(Target, Range("a5:e5")) Is Nothing And Target.Value <> "" Then _
    Target.Offset(1).Value = Date & " " & Time
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top