Function RodsNeeded(rQty As Range, rLen As Range) As Integer
RodsNeeded = rQty * rLen / 96
End Function
You can not work with the total length, you have to get the pieces per rod first.You are correct! I didn't think about that, but your formula given 8 pieces of length 49 returns 0.
Function RodsNeeded(rQty As Range, rLen As Range) As Integer
Dim intBoltsPerRod As Integer
intBoltsPerRod = 96 \ rLen
RodsNeeded = rQty * intBoltsPerRod
End Function
Private Sub Test()
Const QTY = 8
Const LENGTH = 49
Dim intBoltsPerRod As Integer
intBoltsPerRod = 96 \ LENGTH
MsgBox QTY * intBoltsPerRod ' ==> 8
End Sub
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Match on IP address from one worksheet and match results on the next worksheet | 5 | 37 | |
Creating An Intelligent Dropdown | 8 | 30 | |
VBA Excel Copy selected columns | 4 | 22 | |
I am looking for a formula (or other method) to find the average. | 18 | 13 |
Join the community of 500,000 technology professionals and ask your questions.