Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Consolidating Cell comments (Excel XP)

    Is there anyway to "link" all or part of the cell comments in a workbook into one worksheet. For example I use one workbook for each month of the year. In each sheet I keep track of daily temperatures, I then add a comment to the temperature cell for things that I think are "weatherly" i.e. windy, light snow, heavy rain, etc.

    I would like to be able to look at one sheet and see all these comments at a glance.

    TIA

    Bret

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Consolidating Cell comments (Excel XP)

    The code below will place all of the comments in a workbook down column A (starting in A2) in a worksheet named "Comments".

    <pre>Public Sub GetComments()
    Dim oWS As Worksheet, oCell As Range, oComCells As Range, oComSheet As Worksheet
    Dim I As Long
    Set oComSheet = Nothing
    On Error Resume Next
    Set oComSheet = Worksheets("Comments")
    On Error GoTo 0
    If oComSheet Is Nothing Then
    Set oComSheet = Worksheets.Add(after:=Worksheets(Worksheets.Count) )
    oComSheet.Name = "Comments"
    End If
    oComSheet.Range("A2:A65536").ClearContents
    I = 1
    For Each oWS In Worksheets
    Set oComCells = Nothing
    On Error Resume Next
    Set oComCells = oWS.UsedRange.SpecialCells(xlCellTypeComments)
    On Error GoTo 0
    If Not oComCells Is Nothing Then
    For Each oCell In oComCells
    oComSheet.Range("A1").Offset(I, 0).Value = oWS.Name & " " & oCell.Address(False, False) _
    & " " & oCell.Comment.Text
    I = I + 1
    Next oCell
    End If
    Next oWS
    End Sub
    </pre>

    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Mar 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Consolidating Cell comments (Excel XP)

    Works great, Thank You.

    Bret

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •