Using InputBox to populate function

  • Hi experts,


    Someone could help me to use inputbox variables to populate the data to be used in this function.



    Function Cover (Stock As Double, Sales As Range) As Double

    s = Stock
    c = 0

    For Each sale In Sales.Cells
    If s = 0 Then Exit For
    If s >= Val(sale.Value) Then
    c = c + 1
    s = s - Val(sale.Value)
    Else
    c = c + s / Val(sale.Value)
    s = 0
    Exit For
    End If
    Next

    If s > 0 Then c = 9999

    Cover = c

    End Function


    Cheers,


    Gilly

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!