Delete comment markers (2003 SP3)

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

Delete comment markers (2003 SP3)

Post by steveh »

Good morning

I am trying to remove the cell comment indicators/markers from a worksheet and have copied the code that I found on the Contextures website, please see below, but it does not seem to work. I have run it from the VBA page and I have put a button on the form to run it but it does not work, any ideas why please? Second question when it does run and the comments are removed can I then delete the module?

Code: Select all

Sub RemoveIndicatorShapes()
'www.contextures.com\xlcomments03.html

Dim ws As Worksheet
Dim shp As Shape

Set ws = ActiveSheet

For Each shp In ws.Shapes
If Not shp.TopLeftCell.Comment Is Nothing Then
  If Left(shp.Name, 6) = "CmtNum" Then
    shp.Delete
  End If
End If
Next shp

End Sub
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin

User avatar
HansV
Administrator
Posts: 78532
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Delete comment markers (2003 SP3)

Post by HansV »

That code is only intended to remove the triangular shapes added by the macro above it on the Contextures page (Excel Comments VBA), not to remove the built-in comment indicators.

There is no way to delete the built-in indicators. You can hide them (but then you won't see the comments either).

If you want to delete the comments themselves:
- Press Ctrl+G.
- Click Special.
- Select Comments.
- Click OK.
- Select Edit | Clear | Comments.
Best wishes,
Hans

steveh
SilverLounger
Posts: 1952
Joined: 26 Jan 2010, 12:46
Location: Nr. Heathrow Airport

Re: Delete comment markers (2003 SP3)

Post by steveh »

HansV wrote:That code is only intended to remove the triangular shapes added by the macro above it on the Contextures page (Excel Comments VBA), not to remove the built-in comment indicators.

There is no way to delete the built-in indicators. You can hide them (but then you won't see the comments either).

If you want to delete the comments themselves:
- Press Ctrl+G.
- Click Special.
- Select Comments.
- Click OK.
- Select Edit | Clear | Comments.
Thanks Hans

I was afraid that would be the case. I will have to either :grin: and bear it or go through each one and cover it
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin