+ Reply to Thread
Results 1 to 4 of 4

Adding Comments After Close & Re-Open

  1. #1
    Registered User
    Join Date
    04-14-2011
    Location
    Bay Area, CA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Adding Comments After Close & Re-Open

    Howdy,

    So I am trying to add comments to cells if a user changes the value. I am doing that by the following:

    Please Login or Register  to view this content.
    And

    Please Login or Register  to view this content.
    The code works as expected, so that's not the issue. The issue is that I want the comments to be added only AFTER the user has opened the original file, filled it out, saved, & closed it, then re-opened it.

    When the file is first opened, the areas the user is to fill out are blank. However, 1 cell is used as the name of the file when the user clicks "save" - and I have it set up such that the user can keep the file open, fill out all the information for his 1st task, click "save" and then, while keeping the same file open, fill out (ie, change) the information for the 2nd task, and click "save" again (and on, and on, and on). Because each time, the user will have to change the cell which contains the information needed to save it as the file name.

    So, what that means is, I can't have the comments show up just because he changes the cells, because he might be changing the cells several times in one sitting.

    What I'm really looking for is if the user fills out the cells, then saves/closes the workbook, then, upon re-opening, if he then changes the cells - that's when I want the comments to appear.

    Any assistance on how to accomplish this? I was thinking of maybe adding a counter or something, such that upon 1st open, the counter is 0, then the next time the file is opened, the counter is 1, etc... ???

    Thanks in advance,
    Rob

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Adding Comments After Close & Re-Open

    Hi

    Yes you've got the right idea.

    Create a variable cell called say 'CommentTest' and set it to zero and in your procedures add an introductory line

    Please Login or Register  to view this content.
    Now in your Workbook Save Event Event add a line

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-14-2011
    Location
    Bay Area, CA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Adding Comments After Close & Re-Open

    Richard Buttrey,

    Hi, and thank you for the response. The issue I'm facing is that the user can keep the file open & continue to create new workbooks. I have a cell (let's say, A1, which I've called "Student_Name"). Let's say there's another cell (B1, called "Grade").

    If the user types "John Doe" into A1, and "100" into B1 & then clicks "save" the file will rename itself to "John Doe.xlsm"... however, the user can keep the file open & enter "Fred Smith" into cell A1 & "90" into cell B1 & then click "save" & the file will again rename itself to "Fred Smith.xlsm" - the user can do this as many times as he has data for.

    However, once he closes out the final workbook, what I want is the ability to capture the NEXT time the file is opened & changed - that way, if someone (either the original user, or a different user) opens the file called "Fred Smith.xlsm" and changes the grade from "90" to "100" - I want a comment to appear stating such.

    Thanks,
    Rob

    P.S. I think I may have answered my own question - I think I need the event to be on "open" and not on "save"... I'm going to try to implement that & will report back whether it works or not.
    Last edited by rbrookov; 06-08-2014 at 05:24 PM. Reason: possible epiphany

  4. #4
    Registered User
    Join Date
    04-14-2011
    Location
    Bay Area, CA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Adding Comments After Close & Re-Open

    OK, so I figured it out... here is what I did (in case anyone else can be helped by this):

    Please Login or Register  to view this content.

    And:

    Please Login or Register  to view this content.

    And finally:

    Please Login or Register  to view this content.
    So, thank you for getting me on the right track such that I could modify the code to suit my specific needs!!!

    Thanks,
    Rob
    Last edited by rbrookov; 06-08-2014 at 07:14 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to close open workbooks from an application get open filename call ?
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2011, 10:41 PM
  2. Application Open/Close Event - Store Open and Close Times?
    By mccrimmon in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2011, 04:21 PM
  3. Adding comments & deleting comments VBA
    By tian0020 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-26-2007, 08:35 PM
  4. comments moving randonmly after a save & close
    By Tam in forum Excel General
    Replies: 2
    Last Post: 03-31-2006, 01:10 PM
  5. Help, I want to copy comments from close workbook
    By HuggyBear in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-10-2005, 06:32 PM

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