+ Reply to Thread
Results 1 to 2 of 2

Excel Sheet Revision Control

  1. #1
    Registered User
    Join Date
    07-04-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    1

    Excel Sheet Revision Control

    Hello everyone,

    I'm new to this forum and i'm looking at expanding my skillset and I figure since I use excel for many parts of my projects I'd take up learning VBA for excel. Also, I was recently involved in an incident (not the first time) where my manager developed a specification document (done in excel) a while back in which he was no expert or even should be spec-ing anyways. A long story short, he tried to blame me for some errors he made by saying that I did the spec even though I know I didn't. Luckily I always keep records of all documents I produce locally on my machine so if something is on the network and not on my machine, chances are I didn't do it. When I confronted him about it he confidently and half-arrogantly said he had proof that I sent it to him via email. I called him on that bluff, asked him to send me the email for my records because I didn't have the spec, and right away he did a 180 and admitted that maybe he did the spec and "couldn't remember". This has not been the only incident and has happened to some other coworkers as well especially when there's some blatant errors he's made, so I'd like to put something in our templates that will start getting people to be responsible for their work.

    This lead me to attempt to add some functionality to our excel documents. I'm trying to add some revision visibility to certain cells within the documents. What i'm looking to do is that anytime a sheet in a workbook is modified a corresponding cell in the modified sheet will update with the name of the user who modified it (we're on a corporate network so it'll be a user ID like tranh2). Each sheet will have a "Last Modified by:" field and a "Last Modified Date:" field. There will be multiple sheets in each workbook most randomly named sheets. I done some reading and I know I can use the Environ("Username") function to pull the username. Where I am getting stuck is writing the values to only the sheets that are modified and leaving the ones that are not modified alone. I've done some reading with respect to the Worksheet Change event and I tried to implement it but got some range errors. So not sure...i'm new to vba so...tried first before asking.

    So for example, if there are 5 sheets and only sheets 1 and 3 are modified, I'd like to have it so when the user clicks save, only the corresponding cells in sheets 1 and 3 are updated with the user who modified it and the date. Is this possible? And what is the best way to do this?

    Sorry for long email...threw some horrible boss B***tching in there for some who want entertainment reading.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Excel Sheet Revision Control

    Hello

    This may work for you. This macro will add a timestamp with the user's name to comment in a cell of your choosing. It can be called by any sheet's Change event.

    TimeStamp Macro Code
    Copy and paste this into a VBA Module.

    Please Login or Register  to view this content.
    You can add a call to the macro from the Change event on each worksheet you need to track. Here the comment is saved in cell "A1". You can use any cell you like.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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