Consulting

Results 1 to 2 of 2

Thread: all comments in activesheet

  1. #1
    VBAX Mentor
    Joined
    Jun 2005
    Posts
    374
    Location

    all comments in activesheet

    hello
    i wanted to see all comments address in the activesheet on a msgbox.i manage to get the first and the last .how can i see all?.does any one care to comment?
    [VBA]
    Dim i As Integer
    i = ActiveSheet.Comments.Count
    MsgBox ("comments number is: " & i) & Chr(13) _
    & Chr(10) & "first in cell - " & ActiveSheet.Comments(1).Parent.Address & Chr(13) _
    & Chr(10) & "last in cell - " & ActiveSheet.Comments(i).Parent.Address, vbInformation, "comments number & address:"

    [/VBA]
    thanks
    moshe

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Dim NumComments As Long
    Dim i As Long
    Dim msg As String

    With ActiveSheet
    NumComments = .Comments.Count
    msg = "comments number is: " & NumComments & vbNewLine
    For i = 1 To NumComments
    msg = msg & i & "# - " & .Comments(i).Parent.Address & vbNewLine
    Next i
    End With

    MsgBox msg, vbInformation, "comments number & address:"
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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