We help IT Professionals succeed at work.
Get Started

Editing a Comment through a UserForm

Last Modified: 2012-05-11
Attached is a generic workbook of something that  is currently being worked on.  Some of the functionality is not there, and it's not as dynamic as the original, but I think there is enough there for someone to look at to determine what is occurring without having to write a lot of detail.  It's just a very stripped down Sandbox.

Actually, there are three or four questions that I have, but we'll address those one at a time.  Most of the questions happen in the frmHistology SheetCode.  The first two are connected with btn_Submit_click.  Specifically, it works fine until it gets to StringComment:

The first two are somewhat related.  As the UserForm is shown, the values attempt to track the information that is located on the Worksheet by IDX number.  All of that works fine, at least in the original, except I would like to have the  Cell Comments from the logged on User Class to be displayed in the appropriate ListBox2 and TextBox1 on the UserForm. These are  [nADGroup] = "User" or [nADGroup] <> "User" found in Worksheet("Database") A1.

The code works fine for grabbing the contents of the UserForm and placing it within the comment section of the appropriate cell, but how can the reverse be accomplished?

The second part involves adding additional information to a cell that already has a comment in it.  It was mentioned previously that using .....rngCmt.Comment instead of ...rngCmt.AddComment is the procedure for making that happen.  However, it now errors out when just the .Comment is used with the rngCmt.  The AddComment works fine, as long as the cell Comment is empty.  What is it about the range rngCmt that causes it to error out.

The goal is to bring the appropriate Cell Comment into the ListBox2 and TextBox1, or at the very least TextBox1, make any editing changes and then save it back to the same Cell Comment.

Watch Question
Grand Poobah
Most Valuable Expert 2011
Top Expert 2011
This problem has been solved!
Unlock 1 Answer and 13 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE