0

I am using VBA to write user defined public functions, these functions are then called in excel. An example is:

Public Function mg(Qg As Double, Ql As Double, Qo As Double, p As Double, t As Double, z As Double, rs As Double, totalgor As Double, rhog As Double, glr As Double) As Double
'input T in degF
    Dim part1 As Double, part2 As Double

    If Qg > 0 Then
        part1 = (Qg)
    ElseIf glr > 0 Then
        part1 = (Ql * glr)
    ElseIf totalgor > 0 And rs > 0 Then
        part1 = (Qo * (totalgor - rs))
    End If
        part2 = (part1 * z * (14.7 / p) * ((t + 460) / 520) * rhog)
        mg = part2
End Function

When I try to call this function mg in excel, because the function sometimes has a lot of variables, it is impossible to remember every variable for input and it takes too much time to go back to check which variable should be input one by one. I would like to see variables needed to input one by one shown automatically when I call the function in excel. I have seen this before in other excels but don't know how to achieve it here.

Shawn Mehan
  • 4,513
  • 9
  • 31
  • 51
T.Joe
  • 61
  • 1
  • 2
  • 5

0 Answers0