Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Extracting comments from all worksheets in workbook

I have about 15 worksheets in my workbook and I want to extract all of the
comments that are on each sheet as well as the location within the sheet for
those comments. Could someone give me some guidance as to where to start?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Extracting comments from all worksheets in workbook

Give this a try. It list the comment in a new sheet that it creates...

Public Sub ListComments()
Dim wks As Worksheet
Dim wksNew As Worksheet
Dim rngComments As Range
Dim rngResults As Range
Dim rng As Range

Set wksNew = Worksheets.Add
Set rngResults = wksNew.Range("A1")
On Error Resume Next

For Each wks In Worksheets
Set rngComments = Nothing
On Error Resume Next
Set rngComments = wks.Cells.SpecialCells(xlCellTypeComments)
On Error GoTo 0
If Not rngComments Is Nothing Then
For Each rng In rngComments
rngResults.Value = wks.Name
rngResults.Offset(0, 1).Value = rng.Address
rngResults.Offset(0, 2).Value = rng.Comment.Text
Set rngResults = rngResults.Offset(1, 0)
Next rng
End If
Next wks
On Error GoTo 0
End Sub

--
HTH...

Jim Thomlinson


"Barb Reinhardt" wrote:

I have about 15 worksheets in my workbook and I want to extract all of the
comments that are on each sheet as well as the location within the sheet for
those comments. Could someone give me some guidance as to where to start?

Thanks

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
Extracting input from Comments Limes Excel Discussion (Misc queries) 1 February 14th 07 04:19 PM
Extracting Photos from Comments! anagpal75 Excel Discussion (Misc queries) 2 August 4th 06 03:22 AM
extracting comments Ralph Heidecke Excel Worksheet Functions 2 October 28th 04 11:32 PM
Extracting Comments? MrAlMackay Excel Programming 1 September 28th 03 09:29 PM


All times are GMT +1. The time now is 11:39 PM.

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

About Us

"It's about Microsoft Excel"