+ Reply to Thread
Results 1 to 3 of 3

Code to add comment box

  1. #1
    Registered User
    Join Date
    06-29-2006
    Posts
    42

    Code to add comment box

    I was wondering if anyone could tell me why the following code does not automatically add a comment box to the active cell in column O when "JOINT" is entered in. It was working before, but now the comment is added to another cell.

    Please Login or Register  to view this content.
    Thanks!

  2. #2
    NickHK
    Guest

    Re: Code to add comment box

    Chris,
    Assuming this code is within a "With ActiveCell / End With" block, then it
    will add a comment to the active cell, not to the cell in column "O".
    Show the With block as well, as that will determine the location of the
    comment.

    NickHK

    "chris46521" <[email protected]> wrote
    in message news:[email protected]...
    >
    > I was wondering if anyone could tell me why the following code does not
    > automatically add a comment box to the active cell in column O when
    > "JOINT" is entered in. It was working before, but now the comment is
    > added to another cell.
    >
    >
    > Code:
    > --------------------
    > Dim Cmnt
    > If Me.Cells(.Row, "O").Value = "JOINT" Then
    > Set Cmnt = .Comment
    > If Cmnt Is Nothing Then
    > .AddComment
    > .Comment.Visible = True
    > .Comment.Text Text:="COG MEs:" & Chr(10)
    > .Comment.Shape.Select True
    > Else
    > .Comment.Visible = False
    > End If
    > End If
    > --------------------
    >
    > Thanks!
    >
    >
    > --
    > chris46521
    > ------------------------------------------------------------------------
    > chris46521's Profile:

    http://www.excelforum.com/member.php...o&userid=35909
    > View this thread: http://www.excelforum.com/showthread...hreadid=565784
    >




  3. #3
    Registered User
    Join Date
    06-29-2006
    Posts
    42
    Thanks for your reply! Here is the full code:

    Please Login or Register  to view this content.

+ 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