We help IT Professionals succeed at work.

USERFORM TO ADD COMMENTS IN EXCEL DISAPPEARS

127 Views
Last Modified: 2017-03-30
I CREATED A USERFORM  IN EXCEL TO ADD COMMENTS BUT WHEN I CLOSE IT THE COMMENTS DISAPPEAR.  IS THERE A WAY TO RETAIN THE COMMENTS I ADDED
Comment
Watch Question

Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Where are you adding the comments? In a cell?

Author

Commented:
To a cell I suppose.  I'm guessing it needs a place to be stored right?
Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
How do you plan to use these comments?

Author

Commented:
Just for reference.  For each excel sheet I wanted a userform to add comments.
Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Here is code you can use to add a comment to a cell.

Dim strComment As String

    If Range("A1").Comment Is Nothing Then
        strComment = InputBox("Please enter the text of your comment", "Add Comment")
        If StrPtr(strComment) = 0 Or strComment = "" Then
            ' User pressed Escape or left comment blank
            Exit Sub
        End If
        Range("A1").AddComment strComment
    End If

Open in new window

Author

Commented:
Do I add this to a command button?
Social distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
This is great...thank you.  Can this be done on a userform?   At times there will be a lot of information being entered.
Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Can what be done on a userform? Do you mean store the comment in the userform itself? If so the answer is no.

Author

Commented:
I was afraid of that......That was my goal.  I do appreciate your help!

Author

Commented:
Thank you!
Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You're welcome and I'm glad I was able to help.

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2016
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2016
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.