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
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