Consulting

Results 1 to 4 of 4

Thread: Solved: Capture System Time

  1. #1

    Post Solved: Capture System Time

    Dear friends,

    In my excel sheet; I want to assign macro for form button; if I click this button, then I should get system time on the next column of the button.

    Attached is the file for your reference.

    Please help me.

    Thanks.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub Time()
    With ActiveCell

    .Value = Now
    .NumberFormat = "h:mm AM/PM"
    End With
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    Maybe ...


    [VBA]
    Sub Time()
    ActiveSheet.Range("D4").Value = Format(Now, "hh:mm ampm")
    End Sub
    [/VBA]

    Paul

  4. #4
    Quote Originally Posted by Paul_Hossler
    Maybe ...


    [VBA]
    Sub Time()
    ActiveSheet.Range("D4").Value = Format(Now, "hh:mm ampm")
    End Sub
    [/VBA]

    Paul
    Thanks;

    Its working.........

    Thanks a lot..

Posting Permissions

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