function - Return Statement in Excel VBA -
So, I'm having trouble dealing with my video coding return statements, and I do not understand why the reason What is this . I have made a return statement, as I have ever made, yet it seems that I have some mistake. Can anyone tell me where I made a mistake in the statement given by my function?
Public Fees GetPay (Hours, RegHours, Othours, PayRate, RegPay, OTPay) Double Constellation MAX_REG_HOURS Integer = 40 Dim as double as Hours & gt; MAX_REG_HOURS then RegHours = 40 OTHours = Hours - MAX_REG_HOURS or RegHours = Hours so RegPay = CDbl (txtPayRate.Text) OTPay = CDbl (txtPayRate.Text * 1.5) returnRP = RegThours + (OTHours * OTPay) termination Function
Your task is also very complex, for example
- There is a calculation in the
author function, so no input is required because it will be overwritten -
PayRate is unused -
RegPay and OTPay are written without the function - The
RegHours function is counted in As you can see, you can make the function call easier, and input
Examples calling the function sub b () MsgBox GetPay (41, 8.1, 12.1) MsgBox GetPay (44, CDbl (txtPayRate.Text), CDbl (TxtPayRate.Text * 1.5)) End Sub New work Public Fees GetPay (hours, RegPay, OTPay) Double dim MAX_REG_HOURS long dim RegHours double dim OTHours double MAX_REG_HOURS as in the form of as = 40 RegHours = Application.Min (hours, MAX_REG_HOURS) if Nte & gt; MAX_REG_HOURS then OTHours = hours - MAX_REG_HOURS GetPay = (RegPay * RegHours) + (OTHours * OTPay) End Function
Comments
Post a Comment