+ Reply to Thread
Results 1 to 7 of 7

Using time stamp to add to text a cell....

Hybrid View

  1. #1
    Registered User
    Join Date
    11-04-2008
    Location
    London
    Posts
    20

    Using time stamp to add to text a cell....

    Thanks to all you guys that have helped me so far. What i now need to do is use the time stamp that i have previously been given ... but to add to text already in the cell rather than copy over the cells text. The code i am currently using is:

    Sub TimeStampOn()
       ActiveSheet.OnEntry = "Stamper"
    End Sub
    Sub Stamper()
       On Error Resume Next
           ActiveCell.ClearComments
       On Error GoTo 0
       ActiveCell.Range("A1").Value = Date + Time
    End Sub
    Sub TimeStampOff()
       ActiveSheet.OnEntry = ""
    End Sub
    What i am trying to achieve is a list of these dates and times in 1 cell... so if i stamp it once... when i stamp the second time it just lists the time below the previous one in the same cell rather than copying over it. Is this possible?
    Last edited by VBA Noob; 11-07-2008 at 05:38 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, You could try this line in you code:-
    ActiveCell.Value = ActiveCell.Value & Chr(10) & Date + Time
    Regards Mick

  3. #3
    Registered User
    Join Date
    11-04-2008
    Location
    London
    Posts
    20
    Nope... no luck. What does that code do? Hasnt seemed to change anything...

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    I can't find the OnEntry property at all, even in the object browser; is it still supported?

    What are you trying to do?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi, If you just use the code line I sent you in a CommanButton on your sheet. Every time you run the code in the same Activecell, it will add the time & date to the cell along with the original cell information.
    Mick
    Last edited by MickG; 11-06-2008 at 12:06 PM.

  6. #6
    Registered User
    Join Date
    11-04-2008
    Location
    London
    Posts
    20
    ah... thats great thanks... do you know how i can get rid of the seconds? i have tried formatting the cell itself to dd/mm/yyyy hh:mm but it still displays seconds ... i would still like the time but just not seconds ... can anyone help?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1