Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See VBA below. I cannot figure out how to get this to work so that the after
entering in the Name, hours and pay rate for it to calculate the pay and insert in my worksheet. Private Sub CommandButtonOk_Click() If TextBoxEmployeeName.Text = "" Then MsgBox "You must enter a name." Exit Sub End If NextBlankRow = Application.WorksheetFunction.CountA(Range("ColA") ) + 1 'MsgBox (NextBlankRow) Cells(NextBlankRow, 1) = TextBoxEmployeeName.Text Cells(NextBlankRow, 2) = TextBoxHours.Value Cells(NextBlankRow, 3) = TextBoxPayRate.Value If (Hours 40) Then OverTime = Hours - 40 Pay = 40 * PayRate + OverTime * PayRate * 1.5 Else Pay = 40 * PayRate End If TextBoxEmployeeName.Text = "" TextBoxHours.Value = "" TextBoxPayRate.Value = "" TextBoxEmployeeName.SetFocus End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF Statement calculating Average if you have numeric & text respon | Excel Worksheet Functions | |||
Runtime Error - Subscript out of range despite On Error statement | Excel Programming | |||
Path/File access error (Error 75) using Name Statement | Excel Programming | |||
Path/File access error (Error 75) after using Name Statement | Excel Programming | |||
% error calculating grades | Excel Worksheet Functions |