Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Counting Comments

How can I programatically detect if there are any comments on a worksheet?

Geoff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Counting Comments

Sub test()
Dim nComs As Long
nComs = ActiveSheet.Comments.Count

msgbox nComs

End sub

Regards,
Peter T

How can I programatically detect if there are any comments on a worksheet?

Geoff



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Counting Comments

Thanks for that.

Geoff

"Peter T" wrote:

Sub test()
Dim nComs As Long
nComs = ActiveSheet.Comments.Count

msgbox nComs

End sub

Regards,
Peter T

How can I programatically detect if there are any comments on a worksheet?

Geoff




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Counting Comments

Try this function:


Function ccount(r As Range) As Integer
Dim C As Comment
Dim r1 As Range
ccount = 0
For Each r1 In r
On Error Resume Next
Set C = r1.Comment
If Err.Number = 0 Then
ccount = 1 + 1
End If
On Error GoTo 0
Next
End Function

--
Gary's Student


"Geoff" wrote:

How can I programatically detect if there are any comments on a worksheet?

Geoff

Reply
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 2000 how to format the comments font all comments Delquestion Excel Discussion (Misc queries) 1 October 8th 09 02:19 PM
in excel useing comments how do you add clip art to comments? dhouse New Users to Excel 2 July 18th 07 08:14 AM
Counting comments Byron720 Excel Worksheet Functions 1 March 1st 07 07:04 PM
counting comments Robert Shlemkevich Excel Worksheet Functions 2 September 15th 05 08:26 PM
Counting Rows Then Counting Values in Columns Michael via OfficeKB.com Excel Programming 1 June 1st 05 04:10 PM


All times are GMT +1. The time now is 03:48 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"