" Time / Date Stamp Macro "

  • I was wondering if i can get some help i have a vba that auto inputs date/time in another cell if text is entered and if it is deleted it clears the contents. What i need is the date to stamp in one cell and time in a different cell can someone please help thanks. here is what i have i just need to get current time to go into another cell



    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    With Target
    If .Count > 1 Then Exit Sub
    If Not Intersect(Range("A:A"), .Cells) Is Nothing Then
    Application.EnableEvents = False
    If IsEmpty(.Value) Then
    .Offset(0, 1).ClearContents
    Else
    With .Offset(0, 1)
    .NumberFormat = "MM/DD/YY"
    .Value = Now
    End With
    End If
    Application.EnableEvents = True
    End If
    End With
    End Sub

  • Re: VBA


    Hi and welcome to Ozgrid


    [bp]*[/bp]

    Where there is a will there are many ways. Finding one that works for you is the challenge!

  • Re: VBA



    Please edit the thread title to something more appropriate like : " Time / Date Stamp Macro " and also
    place your code inside the Code Tags by utilizing the hash tag symbol in the menu selection.


  • Re: VBA


    This is perfect Logit. There is just one piece missing. If I delete text in column A it just clears the stamp in column B is there a way to also clear it in C if there is no text in A. Thank you