Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning the number of comments in a workbook
I've figured out how to do it in a Word document, but the object model or
something must be different for Excel (2003). How can I have a msgbox pop up and tell me how many comments are in a workbook? thank you! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning the number of comments in a workbook
try something like
Sub test() Dim lCommentCount As Long Dim sht As Worksheet For Each sht In ActiveWorkbook.Worksheets lCommentCount = lCommentCount + sht.Comments.Count Next sht MsgBox lCommentCount & " total comments in the active workbook" End Sub -- Hope that helps. Vergel Adriano "Sue" wrote: I've figured out how to do it in a Word document, but the object model or something must be different for Excel (2003). How can I have a msgbox pop up and tell me how many comments are in a workbook? thank you! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning the number of comments in a workbook
In a worksheet:
MsgBox Cells.SpecialCells(xlCellTypeComments).Count In a multi-sheet workbook: Dim myComment As Integer Dim mySht As Worksheet On Error Resume Next For Each mySht In Worksheets myComment = myComment + mySht.Cells.SpecialCells(xlCellTypeComments).Count Next mySht MsgBox myComment HTH, Bernie MS Excel MVP "Sue" wrote in message ... I've figured out how to do it in a Word document, but the object model or something must be different for Excel (2003). How can I have a msgbox pop up and tell me how many comments are in a workbook? thank you! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning the number of comments in a workbook
Excellent! thank you!!!
"Vergel Adriano" wrote: try something like Sub test() Dim lCommentCount As Long Dim sht As Worksheet For Each sht In ActiveWorkbook.Worksheets lCommentCount = lCommentCount + sht.Comments.Count Next sht MsgBox lCommentCount & " total comments in the active workbook" End Sub -- Hope that helps. Vergel Adriano "Sue" wrote: I've figured out how to do it in a Word document, but the object model or something must be different for Excel (2003). How can I have a msgbox pop up and tell me how many comments are in a workbook? thank you! |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning the number of comments in a workbook
sub ABC()
Dim sh as worksheet Dim cnt as Long for each sh in Worksheets cnt = sh.Comments.count + cnt Next msgbox "Comment count is " & cnt End Sub -- Regards, Tom Ogilvy "Sue" wrote: I've figured out how to do it in a Word document, but the object model or something must be different for Excel (2003). How can I have a msgbox pop up and tell me how many comments are in a workbook? thank you! |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Returning the number of comments in a workbook
Thank you Bernie, this is very helpful
"Bernie Deitrick" wrote: In a worksheet: MsgBox Cells.SpecialCells(xlCellTypeComments).Count In a multi-sheet workbook: Dim myComment As Integer Dim mySht As Worksheet On Error Resume Next For Each mySht In Worksheets myComment = myComment + mySht.Cells.SpecialCells(xlCellTypeComments).Count Next mySht MsgBox myComment HTH, Bernie MS Excel MVP "Sue" wrote in message ... I've figured out how to do it in a Word document, but the object model or something must be different for Excel (2003). How can I have a msgbox pop up and tell me how many comments are in a workbook? thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Returning a column name or number | Excel Worksheet Functions | |||
Finding value and returning row number | Excel Programming | |||
Returning value next to the nth occurrence of a particular number. | Excel Worksheet Functions | |||
returning workbook name | Excel Programming | |||
returning max UsedRange row number | Excel Programming |