TextBox not Updating Cells in Excel

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.

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
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi there. Try replacing .Value with .Text on those 2 textboxes So:

Code:
ws.Cells(iRow, 2).Value = Me.TextBox1.Text
ws.Cells(iRow, 3).Value = Me.TextBox2.Text
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top