Hi everybody!
I have the following code:
Private Sub Textbox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
Me.TextBox1 = Format(Me.TextBox1, "#,##0.00")
End Sub
Private Sub CommandButton1_Click()
Range("B4").Value = "=Round(C2*C10,2)+" & TextBox1.Value
End Sub
If I run this code it gives me a Runtime error '1004': Aplication-defined or object-defined error, and marks the codeline where I want to add the Textbox value to the cell formula.
If I remove the formatting Sub, and enter an integer value, then everything works great, but when I introduce the formatting option or a decimal number the problem starts again.
How can I solve this problem?
Thanks in advance for your help.
Bookmarks