Hi there,
I have another query, and after a day of trialling and searching for an answer, I hope someone here can help...
In my workbook, I have a userform. Userform is a timesheet, and allows for 2 different 'activities' to be entered (if needed) per day. Each combobox will have 4-5options (all the same)
I want to be able to select an option from the drop down box on any/all/some days, enter a number (hours) in the corresponding textbox, then calculate the total wage for each activity (there is also an 'hourly rate' textbox on userform) which will display on a worksheet summary page.
I.e Monday ActivityOne ComboBox = "Growing" Hours = 2
Tuesday Activitytwo combobox = Growing" Hours = 3
Then in my worksheet cell, I want to sum up all the 'Growing' hours (in this case 5), and multiply that by the wage rate, and display the result in the worksheet cell.
This is that portion of my code so far,
It doesn't 'error', all it currently does is display a '0' on my worksheet.....
'copy data to monthly summary and find first empty row
iRow = Worksheets(Right(cmboweekending.Value, 7)).Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
Dim totalhours As Double
Dim totalwage As Double
With sheet
Worksheets(Right(cmboweekending.Value, 7)).Cells(iRow, 1).Value = Me.cmboweekending.Value
Worksheets(Right(cmboweekending.Value, 7)).Cells(iRow, 2).Value = Me.CmboName.Value
Worksheets(Right(cmboweekending.Value, 7)).Cells(iRow, 3).Value = Me.TxtGrossPay.Value
Worksheets(Right(cmboweekending.Value, 7)).Cells(iRow, 5).Value = Me.TxtTotalTax.Value
Worksheets(Right(cmboweekending.Value, 7)).Cells(iRow, 7).Value = Me.TxtKiwiSaver.Value
Worksheets(Right(cmboweekending.Value, 7)).Cells(iRow, 9).Value = Me.TxtStudentLoan.Value
Worksheets(Right(cmboweekending.Value, 7)).Cells(iRow, 10).Value = Me.TxtTotalHours.Value
If CmboActMon1.Value Like Worksheets("Set Up").Range("E6") Or CmboActMon2.Value Like Worksheets("Set Up").Range("E6") Or CmboActTues1.Value Like Worksheets("Set Up").Range("E6") Or CmboActTues2.Value Like Worksheets("Set Up").Range("E6") Or CmboActWed1.Value Like Worksheets("Set Up").Range("E6") Or CmboActWed2.Value Like Worksheets("Set Up").Range("E6") Or CmboActThurs1.Value Like Worksheets("Set Up").Range("E6") Or CmboActThurs2.Value Like Worksheets("Set Up").Range("E6") Or CmboActFri1.Value Like Worksheets("Set Up").Range("E6") Or CmboActFri2.Value Like Worksheets("Set Up").Range("E6") Or CmboActSat1.Value Like Worksheets("Set Up").Range("E6") Or CmboActSat2.Value Like Worksheets("Set Up").Range("E6") Or CmboActSun1.Value Like Worksheets("Set Up").Range("E6") Or CmboActSun2.Value Like Worksheets("Set Up").Range("E6") Then
totalhours = Val(Me.TxtActMonHrs1.Value) + Val(Me.TxtActMonHrs2.Value) + Val(Me.TxtActTuesHrs1.Value) + Val(Me.TxtActTuesHrs2.Value) + Val(Me.TxtActWedHrs1.Value) + Val(Me.TxtActWedHrs2.Value) + Val(Me.TxtActThursHrs1.Value) + Val(Me.TxtActThursHrs2.Value) + Val(Me.TxtActFriHrs1.Value) + Val(Me.TxtActFriHrs2.Value) + Val(Me.TxtActSatHrs1.Value) + Val(Me.TxtActSatHrs2.Value) + Val(Me.TxtActSunHrs1.Value) + Val(Me.TxtActSunHrs2.Value)
End If
totalwage = (Val(Me.TxtHourly.Value) * Val(totalhours))
Worksheets(Right(cmboweekending.Value, 7)).Cells(iRow, 13).Value = totalwage
End With
I will also try to upload the file to save any confusion. The code I am having issues with in the 'Timesheet' userform, under the 'record timesheet' command
Thank you :-)
Bookmarks