+ Reply to Thread
Results 1 to 9 of 9

Button to place a time stamp, save the file, and exit

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    41

    Button to place a time stamp, save the file, and exit

    I have a work center accountability tool and would like to assign a macro to a shape so that when it is clicked it will:

    Put a timestamp into a specific cell
    update all the formulas in the file
    save and check in the file in its current place (SharePoint)(it must be checked out to edit)
    then close the file.

    I already have the shape, and the location for the time stamp (having trouble with getting the macro to focus on a specific cell and not the active cell)

    I am really new to macros and am learning by doing. Any help would be greatly appreciated.

    Taiter

  2. #2
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Button to place a time stamp, save the file, and exit

    Hi Taiter

    Can you post your current code? (Make sure to encapsulate it by selecting it here and pressing the # button above).

    As for the ActiveCell, you can change that to Sheet1.Range("A1") or whatever cell you want.

    Thanks
    Duncan

  3. #3
    Registered User
    Join Date
    06-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    41

    Re: Button to place a time stamp, save the file, and exit

    For the timestamp I have:

    Please Login or Register  to view this content.
    I am working on a master sheet and then will make copies and rename them numerous times based on divisions.

    All the data gets summarized on a cover sheet and graph page that is linked to a PowerPoint.
    Last edited by Taiter; 06-20-2013 at 11:23 AM.

  4. #4
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Button to place a time stamp, save the file, and exit

    OK, if you know which cell you want to place it in, you can just replace the line with ActiveCell with

    Please Login or Register  to view this content.
    If you want it in A2 in Sheet1.

    As for saving and checking in, try:

    Please Login or Register  to view this content.
    at the end of your code.

    Thanks
    Duncan

  5. #5
    Registered User
    Join Date
    06-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    41

    Re: Button to place a time stamp, save the file, and exit

    Do I have to change the "Sheet1" to be active sheet so that when I copy and rename the sheet it will continue to work on just that sheet?

  6. #6
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Button to place a time stamp, save the file, and exit

    It will continue to work on that sheet if the sheet is not active.

    If you want it only on the active sheet, you can use:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    41

    Re: Button to place a time stamp, save the file, and exit

    It still places the stamp in the active cell. I need it to show the result in cell C6 regardless which cell is active.

    This is what I have now:
    Please Login or Register  to view this content.
    What am I missing?

    Thank you for your assistance.

  8. #8
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Button to place a time stamp, save the file, and exit

    You are setting the active cell's value to DT afterwards, you want to remove this line:
    Please Login or Register  to view this content.
    Also you need to change the Selection.NumberFormat line to:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2007, 2010, 2013
    Posts
    41

    Re: Button to place a time stamp, save the file, and exit

    Thank you! It has been a huge help.

+ 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