+ Reply to Thread
Results 1 to 14 of 14

Automatically add comments to specific Cell

  1. #1
    Registered User
    Join Date
    07-13-2016
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    16

    Automatically add comments to specific Cell

    Normally I would have an idea of where or how to start but this time I am stumped. I am not sure if its possible but I would like to automatically add an specific comment to a cell if a criteria is met. I have attached a sample worksheet with sample data. What I would like to happen is if cells B:B matched on both the "Master and Comments" sheet and if on the sheet "Master" cell G:G is no then a comment box would be added to cell G:G on the "Master sheet that equaled "Comments" sheets cell E:E.
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Automatically add comments to specific Cell

    Check it out:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,081

    Re: Automatically add comments to specific Cell

    Try:
    Please Login or Register  to view this content.
    Looks like davesexcel beat me to it>
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Registered User
    Join Date
    07-13-2016
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    16

    Re: Automatically add comments to specific Cell

    Thank you both for the quick response.
    Last edited by Kennylj24; 08-30-2016 at 08:47 AM.

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Automatically add comments to specific Cell

    Thanks Mr. Daves for this wonderful code
    I tested the code and encountered an error .. I discovered it is because adding empty value to the comment so I put two lines to skip the error
    Am I right ? or I misunderstand the problem?
    Is it really a problem if an empty string added to comment?
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  6. #6
    Registered User
    Join Date
    07-13-2016
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    16

    Re: Automatically add comments to specific Cell

    Mumps I tried inserting the VBA as a module under the workbook and I also tried under the sheet I must be doing something wrong as I could not get to work.

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,081

    Re: Automatically add comments to specific Cell

    Do the following: Hold down the ALT key and press the F11 key. This will open the Visual Basic Editor. In the menu at the top click 'Insert' and then click 'Module'. Copy and paste the macro into the empty code window that opens up. Press the F5 key to run the macro. Close the code module window to return to your sheet. There are other quicker ways to run the macro such as assigning it to a button that you would click on your sheet or assigning it to a short cut key.

  8. #8
    Registered User
    Join Date
    07-13-2016
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    16

    Re: Automatically add comments to specific Cell

    Mumps I followed your exact steps and there were no comments. Since you mentioned that assigning it to a button would be easier I agree. So what I did was from the developer tab clicked design mode. The clicked insert active x control button. double clicked the button and pasted the code there... I removed the line first line of code to make it a single click code. I then left the design mode and click the button. There was no response it seems.

  9. #9
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,081

    Re: Automatically add comments to specific Cell

    It is always easier to help and test possible solutions if we could work with your actual file. Perhaps you could upload a copy of your file to a free site such as www.box.com. or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Include a detailed explanation of what you would like to do referring to specific cells and worksheets. If the workbook contains confidential information, you could replace it with generic data.

  10. #10
    Registered User
    Join Date
    07-13-2016
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    16

    Re: Automatically add comments to specific Cell

    The file I attached is the actual file.... Currently it just has test data. I was tasked with seeing if it was possible to create a sheet where we can keep track of rehires. The manager who tasked me to create the sheet stated that she wanted when you place no in the rehire box that a comment be placed in the box indicating the reason for non rehire. Those where the only specifications at this time. I was not sure if it was even possible. Maybe I should co a different route.

  11. #11
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,081

    Re: Automatically add comments to specific Cell

    All the cells in Master, column G that contains a "NO" have a trailing space. The macro is looking for "NO" but doesn't find any because all the NO's are actually "NO " with a space after the letter N. Go through column G, remove all the spaces and try the macro again.

  12. #12
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: Automatically add comments to specific Cell

    your "NO" is actually "NO ", you will have to clear the comment as well.

  13. #13
    Registered User
    Join Date
    07-13-2016
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    16

    Re: Automatically add comments to specific Cell

    Mumps and Dave... simple fix.. thank you both.....This works perfect.. I will use it as a button

  14. #14
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,081

    Re: Automatically add comments to specific Cell

    Glad to help.

+ 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. code to automatically convert cell text to comments
    By tabford in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2017, 06:46 PM
  2. [SOLVED] Finding specific data in cell comments and finding the line# in comments it appears on
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-11-2014, 04:26 PM
  3. Automatically open a comments box when certain text is entered into a cell
    By dfuller29 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-20-2014, 05:46 PM
  4. Add automatically comments depends on cell value
    By greekboyuk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-22-2010, 05:35 AM
  5. Only print comments if specific cell within same row>0
    By ErinRyan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2010, 06:40 PM
  6. Copy Cell Comments Automatically To Another WorkSheet
    By centaur63 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2006, 07:38 PM
  7. [SOLVED] Can Comments be automatically converted to text cell values?
    By tomdog61 in forum Excel General
    Replies: 2
    Last Post: 01-23-2005, 06:06 PM

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