Combobox to enter data on a userform in correct place

PMRetired2012

Board Regular
Joined
Aug 6, 2019
Messages
123
Im goin to try to explain this. What i have is a combobox that has 2 choices in the drop down. what im want to do is write code that will put the correct amount paid under the right name on the worksheet. As in:
I have two names Kim and Sandy in a dropdown box and on the worksheet i have a date in one collum and kim in another colum an sandy in last colum. what i want to do i if i click kim in drop down box and she has been paid 25.00 i want i to show up in the column for kim and the amount. My worksheets are set up monthly so i want it to where if one works one day and she doesnt work for a few days the next time she works it will be right under the last one. i think i have th code written to make that happen,
Im going to show the code i have and what i want someone to do is add the other code to make that happen.
Also i would like You to write code if i choose to use a option button for the names kim and sandy insteard of a combobox.
What i need to know is where and what code do i put to make each situation happen
ALSO the cells that choose for kims information to be put in is: U3:U40
the cells for Sandy information: T3:T40.

Private Sub CommandButton2_Click()
Dim lr As Long
Application.ScreenUpdating = False
Sheet = ComboBox4.Text
If Sheet = "" Then
MsgBox "Select Month", vbInformation, "Error"
Exit Sub
End If
'Update each class sheet Code
Sheets(Sheet).Select
Set findBlank = Range("G2:G40").Find(What:="", lookat:=xlWhole)
findBlank.Select
ActiveCell.Value = DTPicker2.Value
ActiveCell.Offset(0, 1).Value = TextBox4.Text
ActiveCell.Offset(0, 2).Value = TextBox5.Text
ActiveCell.Offset(0, 3).Value = TextBox6.Text
ActiveCell.Offset(0, 9).Value = TextBox7.Text
ActiveCell.Offset(0, 10).Value = TextBox8.Text
'Clear Form
ComboBox4.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""

End Sub

Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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