Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim sh As Worksheet
Dim cmt As Comment For Each sh In ThisWorkbook.Worksheets For Each cmt In sh.Comments select case ucase(cmt.parent.address(0,0)) case is = "A2", "B1" 'do nothing case else cmt.Delete end select Next cmt Next sh (Watch for typos!) Thulasiram wrote: Hello all, Code given below deletes the comments in all the cells in the worksheets. How to modify the code such that comments in the cell A2 and B1 of EACH sheet is not deleted but delete all the other comments in the worksheet? Dim sh As Worksheet Dim cmt As Comment For Each sh In ThisWorkbook.Worksheets For Each cmt In sh.Comments cmt.Delete Next Next Thanks, Thulasiram -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete all cell comments in workbook | Excel Discussion (Misc queries) | |||
How do I color code comments in cells on Excel spreadsheet? | Excel Worksheet Functions | |||
VBA code to delete VBA code in another Workbook | Excel Programming | |||
VB Code to Add Comments to Cells from Several Other Cells | Excel Programming |