LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Clearing Comments

Yes, both will remove all comments, but the first one also removes any other
values in the cell and then shifts cells upward in those columns. So, if you
only want to remove comments, the second one is probably what you should use.
You can specify any range of cells. Example:

For Each c In ActiveSheet.Range("A2:G40").Comments
'code to delete
Next

"kirkm" wrote:

On Sat, 21 Feb 2009 19:18:01 -0800, JLGWhiz
wrote:

To clear contents and comments:
Sub dk()
ActiveSheet.UsedRange. _
SpecialCells(xlCellTypeComments).Delete
End Sub

To clear comments only:

Sub sl()
Dim c As Comment
For Each c In ActiveSheet.Comments
If Not c Is Nothing Then
c.Delete
End If
Next
End Sub


I found that both routines c.Delete removes the comment
completely.

Cheers - Kirk

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 - Clearing All Comments Jeff Lowenstein Excel Discussion (Misc queries) 0 April 10th 09 11:22 PM
Clearing cells without clearing formulas marsjune68 Excel Discussion (Misc queries) 2 April 10th 09 07:39 PM
Clearing Comments? (PeteCresswell) Excel Programming 6 January 22nd 07 10:07 AM
Code seems to crash after clearing comments L. Howard Kittle Excel Programming 2 February 20th 06 06:43 PM
Code crashes after clearing comments L. Howard Kittle Excel Worksheet Functions 2 February 20th 06 04:54 AM


All times are GMT +1. The time now is 04:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"