LUIS FREUND
asked on
USERFORM TO ADD COMMENTS IN EXCEL DISAPPEARS
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
Where are you adding the comments? In a cell?
ASKER
To a cell I suppose. I'm guessing it needs a place to be stored right?
How do you plan to use these comments?
ASKER
Just for reference. For each excel sheet I wanted a userform to add comments.
ASKER
see attachment
C--Users-lfreund-Desktop-comments.xlsm
C--Users-lfreund-Desktop-comments.xlsm
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
ASKER
Do I add this to a command button?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is great...thank you. Can this be done on a userform? At times there will be a lot of information being entered.
Can what be done on a userform? Do you mean store the comment in the userform itself? If so the answer is no.
ASKER
I was afraid of that......That was my goal. I do appreciate your help!
ASKER
Thank you!
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
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