close

Hi,

I inserted the Macro below into a series of macros. If there is(are) NO
comment(s) in the worksheet, my macros will not run properly. Please edit my
macro so if there is(are) NO comment(s), the rest of the macros will still
run.

Sub DeleteComments()
Application.Goto Reference:=quot;My_Rangequot;
Selection.SpecialCells(xlCellTypeComments).Select
Selection.EntireRow.Delete
End Sub

Thank You.Danny,

TrySub DeleteComments()
Application.Goto Reference:=quot;My_Rangequot;
On Error Resume Next
Selection.SpecialCells(xlCellTypeComments).Select
If Err.Number = 0 Then
Selection.EntireRow.Delete
End If
End Sub--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

quot;Dannyquot; gt; wrote in message
news
gt; Hi,
gt;
gt; I inserted the Macro below into a series of macros. If there
gt; is(are) NO
gt; comment(s) in the worksheet, my macros will not run properly.
gt; Please edit my
gt; macro so if there is(are) NO comment(s), the rest of the macros
gt; will still
gt; run.
gt;
gt; Sub DeleteComments()
gt; Application.Goto Reference:=quot;My_Rangequot;
gt; Selection.SpecialCells(xlCellTypeComments).Select
gt; Selection.EntireRow.Delete
gt; End Sub
gt;
gt; Thank You.
gt;

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()