+ Reply to Thread
Results 1 to 26 of 26

Need help recreating comment box

  1. #1
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Need help recreating comment box

    At my job I am using an old template that is password protected and no one knows it so I am trying to recreate the look and feel. I have a lot done but can not figure out how this comment box was created. Doesn't seem to be Macro but I can't really access any vba or macro cause it is also protected.

    comment box.PNG

    Any help in recreating this type of comment box for cells I would appreciate.

    Thanks.

  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

    Re: Need help recreating comment box

    Good afternoon cybermanager

    This was done using a userform.
    To design your own, go into the VBE (Alt + F11) and go to Insert > Userform.

    Use the tools there to draw your own dialog box. You will need to use VBA to get the buttons working, but first things first. Sort out the userform, then post back.

    HTH

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

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Need help recreating comment box

    Attached file will unprotect the VBA macros. Open both at the same time and run it.
    Also, add the following code into the worksheet module(right click on it, view code, paste it) and run it. It will unprotect the sheet:
    Please Login or Register  to view this content.
    Last edited by dominicb; 08-28-2019 at 08:08 AM.
    Click the * to say thanks.

  4. #4
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    Okay thank you so much. Once I have it created I will be back :-)

  5. #5
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    I was able to recreate it, not exactly lol but pretty much. How would I link it so when people go to insert comment this box appears and when you hit save it saves the comment in the cell.

  6. #6
    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

    Re: Need help recreating comment box

    PaulM100 you have been here long enough to know the rules by now.

    Administrative Note:

    Welcome to the forum.

    Sorry, but your post does not comply with Rule #7 of our Forum RULES:

    Don't post questions regarding breaking or bypassing any security measure.

    Such threads will be closed and repeat offenders will be banned. This includes posting of links to sites that offer software, code or services to do this or the posting of code to remove passwords.

  7. #7
    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

    Re: Need help recreating comment box

    Hi cybermanager

    Can you just confirm :

    How do your users call the routine that shows your newly designed comment box?
    Does this place a standard Excel comment against the cell?
    Also, does it place the comment in the currently active cell?

    HTH

    DominicB

  8. #8
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    So in the password protected document when a user right clicks in a box three menu options appear, Comment, Font, Fill...I need to figure out how to create that context menu for this workbook only but when they click Comment the box pops up and then it is saved like a regular comment in the chosen cell with the little red comment indicator. If you then over over the cell it will show the comment like normal.

    I hope that makes sense lol.

    Edit: Also when you go back in and hit comment it brings the comment up and you can add to it or delete it.
    Last edited by cybermanager; 08-28-2019 at 08:23 AM.

  9. #9
    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

    Re: Need help recreating comment box

    Hi cybermanager
    Quote Originally Posted by cybermanager View Post
    ... when a user right clicks in a box three menu options appear, Comment, Font, Fill ...
    In the interest of faithfully recreating the original, can you post an image of what this box / three menu optionbs look like? We should thne be ablt o determine which controls have been used.

    HTH

    DominicB

  10. #10
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    So to add the comment we right click and get this box.

    Attachment 639189

    We choose Comment and get the Comment Box.

    Attachment 639190

    Then if I hover over the cell we can see the note.

    Attachment 639191

    If I repeat the process for the same cell it brings up the comment box with the previous comment still in and we can update it and/or add more information, save and or delete.

  11. #11
    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

    Re: Need help recreating comment box

    Hi cybermanager

    OK, this code will drive your context sensitive right click menu. For all of these you will need your VBE open. This assumes that your userform is called UserForm1 (this is the default name for a new userform, so unless you've deliberately changed it, this is what it will be).

    First of all copy this into a new module (Insert > Module)
    Please Login or Register  to view this content.
    Then copy this into the ThisWorkbook module (see in your Project window on the left hand side)
    Please Login or Register  to view this content.
    Then restart Excel and you should have a new item in your right click menu. Once that's working, we'll worry about the userform buttons.

    HTH

    DominicB
    Last edited by dominicb; 08-28-2019 at 10:11 AM.

  12. #12
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    I got this working though how do I get the format and edit as their own under Comment and use comment to bring up the userform? How do I make sure the right click only works for this workbooks and not other workbooks?

    Edit: How do I remove Paste Options from the right click menu?

    Edit2: I got it so it is its own button and when clicked brings up userform. Though once 'comment' is added even if I hit cancel it shows that a comment was added. And how do I remove the Delete comment and hide/show comment buttons that show up in the right click menu? Still need it for just this work book?
    Last edited by cybermanager; 08-29-2019 at 06:45 AM.

  13. #13
    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

    Re: Need help recreating comment box

    Hi cybermanager
    Quote Originally Posted by cybermanager View Post
    Still need it for just this work book?
    Add this code to what is already in your ThisWorkbook object :
    Please Login or Register  to view this content.
    As far as adding comments goes, you're going to have to bear in mind that, so far, I haven't given you any code for adding comments, so you've obviously either got some code from somewhere else, or put it together yourself.
    You will have to share this code so I can see what you're working with, or post the workbook. The workbook would be better, but I don't need to see any data - just the structure of how your code is working.

    HTH

    DominicB

  14. #14
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    So I just worked with your code and looked around. This is what I have now.

    Please Login or Register  to view this content.

    I just need to figure out how to reread the comment and add to it, get the delete button to delete all comments in the active cell and take these two buttons off of the right click menu once comment is put in. Picture below:

    newcommentright.PNG
    Last edited by dominicb; 08-29-2019 at 08:47 AM.

  15. #15
    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

    Re: Need help recreating comment box

    Hi cybermanager

    Remove what you have put in the EditComment sub and put it back to how I gave it to you originally.
    From what you've said, the comment routine will be controlled from the userform so we need the routine to open the userform and pass control over. Will the userform be used for adding comments only, or may comments be edited as well?

    I will come back to you shortly with some code to start your userform working.

    HTH

    DominicB

    In the meantime :
    Administrative Note:

    Welcome to the forum.

    In future please include code tags around your code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (As this is your first thread, I have added the tags for you on this occasion

  16. #16
    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

    Re: Need help recreating comment box

    Hi cybermanager

    From the VBE, navigate to your userform, and double click in any blank space.
    This should open up a code window for your userform. Paste this code into it (this assumes the textbox of your userform is called TextBox1) :
    Please Login or Register  to view this content.
    I now need to know from you what your buttons are called (eg CommandButton1 etc) and what you expect each one to do. Also, does your userform contain any more controls than three command buttons and a textbox, for the comment text?

    HTH

    DominicB

  17. #17
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    The comments can be edited as well with that comment button. If you hit it the first time it gives you a blank text box once it is saved if you hit comment again it brings up the userform with the previous note still in it. You can then write more or edit previous comment.

  18. #18
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    The form only has those three buttons, the Cancel Button (cancelbutton) cancels the userform, the Delete Button (Delbutton) Deletes all comments in that cell, the Save Button (Savebutton) saves the comment and then closes the userform as well.

  19. #19
    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

    Re: Need help recreating comment box

    Hi cybermanager

    Finally, add this code to your userform code (needs to go into the same window as your "UserForm_Initialize" routine).

    Please Login or Register  to view this content.
    HTH

    DominicB

  20. #20
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    Thank you. I am still having trouble with the right click menu. I can get everything removed except if there is a comment and I right click on that cell it shows delete comment, edit comment, show/hide comment...I need this removed but when I try it says that insert comment is invisible and so give an error.

  21. #21
    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

    Re: Need help recreating comment box

    Hi cybermanager

    Attached is an empty file, with all the code that I've posted in this thread : if I understand what you are saying correctly, then the type of behaviour you are describing is not displayed in this file.
    Can you try this file and see if it works OK? If so, you need to find out where your code differs from mine. If you can't see why you're having this issue then post your workbook and I'll take a look.

    HTH

    DominicB




    To attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Attached Files Attached Files
    Last edited by dominicb; 09-04-2019 at 04:07 AM.

  22. #22
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    The comment section works fine. The problem is taking away the rest of the right click menu so it is like the attached picture.
    right click.PNG

    I can get the insert comment to be deleted and/or invisible but once a comment is placed in to the active cell and I try and have delete comment, edit comment deleted from right click menu I then get
    an error for insert comment being invisible.

  23. #23
    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

    Re: Need help recreating comment box

    Hi cybermanager
    Quote Originally Posted by cybermanager View Post
    The comment section works fine. The problem is taking away the rest of the right click menu so it is like the attached picture.
    So, you want to blitz the entire right click menu, and just have your comment menu show? You need a few changes :
    First, change your Workbook-Open event code to look like this :
    Please Login or Register  to view this content.
    Now, change your AddToCellMenu module to look like this :
    Please Login or Register  to view this content.

    Quote Originally Posted by cybermanager View Post
    I can get the insert comment to be deleted and/or invisible but once a comment is placed in to the active cell and I try and have delete comment, edit comment deleted from right click menu I then get
    an error for insert comment being invisible.
    You need to help me out here - read the above. With your workbook in front of you, and with the benefit of you pretty much knowing it inside out, your above narrative might make some sort of sense to you.

    Unfortunately, I have no clue what you're asking for, and what works and what doesn't work. Brevity and conciseness may well have its place in an online discussion forum, and whilst I accept that English may or may not be your native language (which I do make allowances for) I at least need to understand your issues.

    HTH

    DominicB

  24. #24
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    I apologize for not being clear. I do have the issue figured out. If you can just help me remove the box above my context menu, I can't seem to figure out what it is called. It has options for font, font size, borders, symbols, etc...

    Attachment 640408

  25. #25
    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

    Re: Need help recreating comment box

    Hi cybermanager

    You can get rid of it from your Excel options screen : File > Options > General and then untick the box marked "Show Mini Toolbar on selection"


    If you want to use VBA to do so, then the below line will toggle it on / off :
    Please Login or Register  to view this content.
    HTH

    DominicB

  26. #26
    Registered User
    Join Date
    08-28-2019
    Location
    Roseville
    MS-Off Ver
    excel 2013
    Posts
    15

    Re: Need help recreating comment box

    Thank you I got the floatie away by using the
    Please Login or Register  to view this content.
    I thought I had the right click menu working but I am still in my little snag lol. When you first right click you get exactly what I want. Attachment 640725

    But after inserting the comment, my right click menu looks like this...Attachment 640726

    I use the code
    Please Login or Register  to view this content.
    Seems to remove the insert comment option but after comment is placed and I reclick on it I get Delete and Show/Hide Comments, need this to go away.

+ 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. Recreating this lookup in Excel
    By TheBigEgg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-16-2019, 06:21 AM
  2. Recreating this lookup in Excel
    By TheBigEgg in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 07-16-2019, 06:17 AM
  3. [SOLVED] help on recreating graph
    By sarahmw in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-25-2016, 08:59 AM
  4. [SOLVED] Recreating a new table removing all the 0's
    By mikehu in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-25-2015, 12:12 PM
  5. Disable Delete Comment, Edit Comment, Show/Hide Comment
    By Shanthan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2013, 06:12 AM
  6. Recreating a table
    By laguna92651 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-06-2012, 10:32 PM
  7. Contemplating recreating workbook
    By blue9244 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2008, 08:57 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