Excel Hints

Results 1 to 3 of 3

Thread: Solved: Transferring the Userform Textbox Values To a Single Cell As Comment Indicator

  1. #1

    Post Solved: Transferring the Userform Textbox Values To a Single Cell As Comment Indicator

    Hi,
    I would like to explain my situation first.

    Scenario:[/b]
    I am using a UserForm which has few CheckBoxes and TextBoxes (next to the CheckBoxes). For Instance, the CheckBoxes are considered as criterias which are not fulfilled according to the user. The User checks the criterias and adds Comments in the respective TextBox next to the CheckBox.

    My Question:
    I need a code to merge the values in the TextBoxes and publish the value as a SINGLE Comment to a Cell.

    I would be very grateful if anyone could help me in this regard.
    Many Thanks
    Kind Regards,
    Shiva

  2. #2
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    991
    Location
    VB:
    Dim A As String 
     
    On Error Resume Next 
    A = ActiveSheet.Range("A1").Comment 
     
    If Err.Number = 91 Then 
        With ActiveSheet.Range("A1").AddComment 
            .Text Me.TextBox1.Text & " " & Me.TextBox2.Text 
        End With 
    Else 
        ActiveSheet.Range("A1").Comment.Text Me.TextBox1.Text & " " & Me.TextBox2.Text 
    End If 
     
    On Error Goto 0 
    
    
    Formatting tags added by mark007

    David


  3. #3

    Post

    Thank you Tinbendr
    /S


    Quote Originally Posted by Tinbendr
    VB:
    Dim A As String 
     
    On Error Resume Next 
    A = ActiveSheet.Range("A1").Comment 
     
    If Err.Number = 91 Then 
        With ActiveSheet.Range("A1").AddComment 
            .Text Me.TextBox1.Text & " " & Me.TextBox2.Text 
        End With 
    Else 
        ActiveSheet.Range("A1").Comment.Text Me.TextBox1.Text & " " & Me.TextBox2.Text 
    End If 
     
    On Error Goto 0 
    
    
    Formatting tags added by mark007

Posting Permissions

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