I have the following linear formula that I would like to use a button in excel to calculate: y = 0.0069x + 17.631
My plan was to input a value that I assigned to the cell "PackageWeight", and then when the button is clicked it calculates the above formula and yields "DispatchMinutes", or "y". I used the following code:
Private Sub TrucksDTButton_Click()
Dim WeightValue As Double
Dim MinutesValue As Double
WeightValue = wsDispatchButtonsSheet.Range("PackageWeight").Value
MinutesValue = wsDispatchButtonsSheet.Range("DispatchMinutes").Value
MinutesValue = 0.0069 * WeightValue + 17.631
End Sub
However, whenever I run the code, it yields the "Run time '
424' Error - Object Required".
Where did I go wrong in this code?