Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comments locked? 1

Status
Not open for further replies.

notuserfriendly

Programmer
May 7, 2004
82
SE
Hi again

I'm having trouble with .ClearComments
It doesn't clear the comments when the sheet is locked.
I've tried to unlock it but still the same problem.

Any ideas?
 
I've tried to unlock it but still the same problem.
By this do you mean you Unprotected the worksheet. If not, try this (then re-Protect after). It works for me.


Regards,
Mike
 
Code:
ThisWorkbook.Unprotect("pass")
Application.EnableEvents = False
 With Range(ws.Cells(SRow, SCol), ws.Cells(ERow, ECol))
  .ClearFormats
  .ClearComments
  .ClearContents
 End With
Application.EnableEvents = True
ThisWorkbook.Protect("pass")
 
You are Unprotecting & Protecting the Workbook not Worksheet

Check your worksheet protection.


Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top