VBA judges whether the comment in an Excel table exists. It is not as complicated as you think.

Source: Internet
Author: User
It may be because VBA does not provide comment. the exists method is similar, so it may be very troublesome to solve the problem. when I went back to bed in the evening, I suddenly came up with an idea and used object is nothing to judge it. I tried it this morning and it was supposed to be like this. in fact, I tried this one yesterday, but I forgot to use "is" instead of "=" in VB to determine whether a certain object is a nothing. the Code is as follows: if not msheet. cells (rowindex, colindex ). comment is nothing then
Msheet. cells (rowindex, colindex). Comment. Delete
Msheet. cells (rowindex, colindex). addcomment (errortext)
Else
Msheet. cells (rowindex, colindex). addcomment (errortext)
End if

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.