+ Reply to Thread
Results 1 to 6 of 6

How can i edit a cell comment..?

Hybrid View

  1. #1
    Registered User
    Join Date
    09-30-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    22

    How can i edit a cell comment..?

    How can i edit a cell comment...i need to update the cell comment values in loop.
    Any help will be appreciated...

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: How can i edit a cell comment..?

    Hello,

    to add some text and the the current date to any existing comment in the sheet, for example, use code along the lines of

    Dim cmt As Comment
    Dim mystr As String
    For Each cmt In Worksheets("Sheet1").Comments
        mystr = cmt.Text
        cmt.Text mystr & " last changed: " & Date
    Next cmt

  3. #3
    Registered User
    Join Date
    09-30-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: How can i edit a cell comment..?

    For j = 2 To v + 1
    Sheets("Sheet1").Select
    fault = Cells(j, 19).Value
    Affecser = Cells(j, 15).Value
    Range(num2char(col) & 3).AddComment.Text Text:=fault & "(" & Affecser & ")"
    Next j
    for each j value i need to append the respective fault value in the comment box...i need help regarding this..so any one who knows pls let me know its urgent..thanks to all for their support
    Last edited by sharmanjali87; 12-13-2010 at 05:14 AM.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: How can i edit a cell comment..?

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: How can i edit a cell comment..?

    try this:

    For j = 2 To v + 1
    ' Sheets("Sheet1").Select
    fault = Cells(j, 19).Value
    Affecser = Cells(j, 15).Value
    If Not Cells(j, col).Comment Is Nothing Then
        myStr = Cells(j, col).Comment.Text
        Cells(j, col).Comment.Delete
        Cells(j, col).AddComment.Text myStr & Chr(10) & fault & "(" & Affecser & ")"
    End If
    Next j
    If a cell has a comment, the new text will be appended in a new line. If a cell does not have a comment, it will be skipped, i.e. no comment will be added.

    cheers

  6. #6
    Registered User
    Join Date
    09-30-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    22

    Smile Re: How can i edit a cell comment..?

    Thanx for ur reply...its working...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1