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