Results 1 to 8 of 8

Thread: How to create a macro that puts today's date and time in cell

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    One way.
    Sub Maybe()
    Select Case ActiveCell.Address
        Case Is = Cells(1, 1).Address
            ActiveCell.Value = Format(Now, "mm/dd/yyyy HH:mm:ss")
                Cells(1, 2).Select
        Case Is = Cells(1, 2).Address
            ActiveCell.Value = Format(Now, "mm/dd/yyyy HH:mm:ss")
                Cells(2, 1).Select
        Case Is = Cells(2, 1).Address
            ActiveCell.Value = Format(Now, "mm/dd/yyyy HH:mm:ss")
                Cells(2, 2).Select
        Case Is = Cells(2, 2).Address
            ActiveCell.Value = Format(Now, "mm/dd/yyyy HH:mm:ss")
                Cells(1, 3).Select
        Case Else
    End Select
    End Sub
    Last edited by jolivanes; 10-12-2020 at 05:15 PM. Reason: Keep Consistent

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •