I currently have a UserForm which has 5 TextBox's and 1 CommandButton2 (Enter Button). I've written a code that will allow me to enter a dollar amount into TextBox8. After hitting the CommandButton2, it then sends the dollar amount data to the Worksheet in Cell C39. There are dollars amounts in Cell C49 and G49 which are calculated from Cell C39. I would like for TextBox9 and 10 to reflect the updated data from the Cells, in TextBox 9 and 10 without the UserForm closing. The current code that I am using is as:
_________________________________________________________________
Private Sub CommandButton2_Click()
Dim LastRow As Range
Dim Response As Integer
Set LastRow = Worksheets("TTL VS. TTP Calculator").Range("C39")
LastRow.Offset(0, 0).Value = TextBox8.Text
TextBox8.Text = ""
End Sub
_________________________________________________________________
I also had to format the TextBox's to show the dollar amount reflected below.
Private Sub TextBox9_AfterUpdate()
TextBox9.Text = Format(TextBox9.Text, "$#,##0.00")
End Sub
Private Sub TextBox10_AfterUpdate()
TextBox10.Text = Format(TextBox10.Text, "$#,##0.00")
End Sub
_________________________________________________________________
And last, i have a code to initalize the UserForm
Private Sub UserForm_Initialize()
TextBox9.Text = Worksheets("TTL VS. TTP Calculator").Range("C49").Text
TextBox10.Text = Worksheets("TTL VS. TTP Calculator").Range("G49").Text
End Sub
_________________________________________________________________
Private Sub CommandButton2_Click()
Dim LastRow As Range
Dim Response As Integer
Set LastRow = Worksheets("TTL VS. TTP Calculator").Range("C39")
LastRow.Offset(0, 0).Value = TextBox8.Text
TextBox8.Text = ""
End Sub
_________________________________________________________________
I also had to format the TextBox's to show the dollar amount reflected below.
Private Sub TextBox9_AfterUpdate()
TextBox9.Text = Format(TextBox9.Text, "$#,##0.00")
End Sub
Private Sub TextBox10_AfterUpdate()
TextBox10.Text = Format(TextBox10.Text, "$#,##0.00")
End Sub
_________________________________________________________________
And last, i have a code to initalize the UserForm
Private Sub UserForm_Initialize()
TextBox9.Text = Worksheets("TTL VS. TTP Calculator").Range("C49").Text
TextBox10.Text = Worksheets("TTL VS. TTP Calculator").Range("G49").Text
End Sub