gsheppar
Active Member
- Joined
- May 15, 2005
- Messages
- 281
Hey everyone,
I have a userform with 3 entry boxes. 1 for a date (ComboBox1) and 2 Text Boxes to update values (dollar values). When I use the code below on my CommandButton to update it is only adding the date, but not adding the other 2 values. What am I missing? I am trying to update columns A:C, A=ComboBox, B=TextBox2, C=TextBox3.
I have a userform with 3 entry boxes. 1 for a date (ComboBox1) and 2 Text Boxes to update values (dollar values). When I use the code below on my CommandButton to update it is only adding the date, but not adding the other 2 values. What am I missing? I am trying to update columns A:C, A=ComboBox, B=TextBox2, C=TextBox3.
Code:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Tracker")
'iRow finds the Row (Date) to update
iRow = Application.WorksheetFunction.CountA(Worksheets("Tracker").Range("A7:A9999")) + 7
'Copy the Data to the Tracker Sheet
ws.Cells(iRow, 1).Value = Me.ComboBox1.Value
ws.Cells(iRow, 2).Value = Me.TextBox1.Value
ws.Cells(iRow, 3).Value = Me.TextBox2.Value
'clear the data
Me.ComboBox1.Value = ""
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.ComboBox1.SetFocus
Application.ScreenUpdating = True
End Sub