+ Reply to Thread
Results 1 to 3 of 3

Userform, insert comment in a worksheet

Hybrid View

  1. #1
    Registered User
    Join Date
    10-27-2012
    Location
    Brevik, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    2

    Userform, insert comment in a worksheet

    I have a Userform whit two dropdowns from where I select groupe and subgroupe, and a textbox where I write a number. It works fina. Now I want another textbox where I write a comment, and when I hit Updata I want the program to add a comment to the cell whera I updated whit the number. There is same problem whit the code between Userform and worksheets. Can somebody help me, Thanks Bengt Brevik

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,444

    Re: Userform, insert comment in a worksheet

    Should help you get started.

    Userform with textbox and commandbutton

    Private Sub CommandButton1_Click()
    
        Dim objComment As Comment
        
        On Error Resume Next
        Set objComment = ActiveCell.Comment
        On Error GoTo 0
        
        If objComment Is Nothing Then
            ' new comment
            Set objComment = ActiveCell.AddComment
        End If
        
        objComment.Shape.TextFrame.Characters.Text = TextBox1.Text
        
    End Sub
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    10-27-2012
    Location
    Brevik, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Userform, insert comment in a worksheet

    Thank you, Andy.

+ 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