Consulting

Results 1 to 3 of 3

Thread: Adding to existing comments

  1. #1
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location

    Adding to existing comments

    Why doesn't the 3rd line work?

    time_difference_text = Worksheets("Overall standings").Range(lowest_score_address).Comment.Text
    comment_to_be_added = "Dropped score = " & Cells(i, lowest_score_column).Value & " / Time difference = " & time_difference_text
    Worksheets("Overall standings").Range(lowest_score_address).AddComment = comment_to_be_added

  2. #2
    VBAX Tutor lynnnow's Avatar
    Joined
    Jan 2005
    Location
    Mumbai, Maharashtra, India
    Posts
    299
    Location
    try this:

    [VBA]If Not Range("B3").Comment Is Nothing Then
    NewText = Range("B3").Comment.Text & vbCrLf & "Hello"
    Range("B3").Comment.Delete
    Range("B3").AddComment NewText
    End If[/VBA]

    change the ranges though.

    HTH

    Lincoln

  3. #3
    VBAX Regular
    Joined
    Dec 2007
    Posts
    78
    Location
    Quote Originally Posted by lynnnow
    try this:

    [vba]If Not Range("B3").Comment Is Nothing Then
    NewText = Range("B3").Comment.Text & vbCrLf & "Hello"
    Range("B3").Comment.Delete
    Range("B3").AddComment NewText
    End If[/vba]

    change the ranges though.

    HTH

    Lincoln
    Thanks, that worked

Posting Permissions

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