PDA

View Full Version : Solved: Transferring the Userform Textbox Values To a Single Cell As Comment Indicator



antzint
05-01-2012, 06:39 AM
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

Tinbendr
05-01-2012, 03:32 PM
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

antzint
05-02-2012, 04:07 AM
Thank you Tinbendr
/S



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