+ Reply to Thread
Results 1 to 8 of 8

Modifying a Macro Button to time stamp when the button was clicked.

  1. #1
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Modifying a Macro Button to time stamp when the button was clicked.

    I have a button that labeled "Employee Signature" that when pressed, uses an image from another part of the worksheet and places it in the signature box (it is a scan of the employee's signature). The code is as follows:


    Please Login or Register  to view this content.

    Is there a way to add to the VBA for this button so that it automatically time stamps cell AK69 with the date and time that the button was clicked; formatted as: 12/21/10 14:01

    Thanks again in advance for any assistance with this!
    Last edited by jonvanwyk; 12-22-2010 at 01:35 AM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Modifying a Macro Button to time stamp when the button was clicked.

    Good evening jonvanwyk

    Something like :
    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Modifying a Macro Button to time stamp when the button was clicked.

    Add this in your button click to stamp the date/time in the cell you want it to hit when the button is clicked

    Please Login or Register  to view this content.
    see if that gives you what you want.



    ....whoops....I'm a slow typist... ...see post above
    Last edited by jwright650; 12-21-2010 at 04:21 PM. Reason: slow typist
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  4. #4
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Modifying a Macro Button to time stamp when the button was clicked.

    dominicb...your solution worked perfectly. I do have one other issue now though. When I click on the "Employee Signature" button, the code below appropriately places the signature, and timestamps the approrpriate cell. If the "Employe Signature" button is clicked again, it also appropriately refreshes the time stamped in AK69. However, it copies an additional signature on top of the old one so that there are now two images on top of each other. The more times you click the button, the more images are stacked. Is there anyway to prevent this? For it to detect that there is already an image there, and prevent stacking? Thanks again!


    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Modifying a Macro Button to time stamp when the button was clicked.

    When they hit this cmd button, have they entered everything they need to and can close the window at this point?

    If so, add a "Close" or "Unload Me" line before the end sub...that way they won't get a second click.

  6. #6
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: Modifying a Macro Button to time stamp when the button was clicked.

    I want them to get a second click. If they change something on their timesheet, or have to work unanticipated overtime, they need the ability to click on the signature button again, and have the date/time refresh with the "most recent signature". What I really need is for AF66 to ignore the click if there is already an image in AF66. This way AK69 is still able to update with a refreshed timestamp.

  7. #7
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Modifying a Macro Button to time stamp when the button was clicked.

    Maybe someone with more experience will chime in and set me straight if I'm off base.

    [non VBA techy speak on]
    I would think you could add a "replace" in there to simply replace the picture with the same picture, or have it look at that cell where the pic is and do nothing to that cell if it see the pic, step over and continue on through updating the other cells where the updated info is important.[/non VBA techy speak off]

  8. #8
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Modifying a Macro Button to time stamp when the button was clicked.

    How did you end up fixing the picture stacking issue?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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