Alvinpereira
New Member
- Joined
- Apr 28, 2015
- Messages
- 19
Hi,
Can you please help me with this doubt.
Suppose we have a formula HL = (F*L(V^2))/ (2*g*(d^4)) were V = G/A. Now just assume that F, L, G and D are constants i.e. F = 0.79, L = 1, G = 9.81, A = 0.04
So when i made a function i input Q as an argument with data type *** double.
Example:
Function HEADLOSS(Q As Double)
Dim F As Double
Dim L As Double
Dim A As Double
Dim G As Double
Dim D As Double
Dim V As Double
F = 0.79
L = 1
A = 0.04
G = 9.81
D = 0.2
V = Q / A
HEADLOSS = ((F * L) * (V ^ 2)) / ((2 * G) * (D ^ 4))
End Function
It works fine. But what i now need to do is make a function keeping in mind that all other variables except G can change. In the above example Q is the one which we pick up from the excel sheet. But sometimes if not Q which should be referred to, can be F also.
SO how to i put a case where i can select the Letter and that goes into the Argument and makes the rest constants in the same formula.
Can some one please help me?
Can you please help me with this doubt.
Suppose we have a formula HL = (F*L(V^2))/ (2*g*(d^4)) were V = G/A. Now just assume that F, L, G and D are constants i.e. F = 0.79, L = 1, G = 9.81, A = 0.04
So when i made a function i input Q as an argument with data type *** double.
Example:
Function HEADLOSS(Q As Double)
Dim F As Double
Dim L As Double
Dim A As Double
Dim G As Double
Dim D As Double
Dim V As Double
F = 0.79
L = 1
A = 0.04
G = 9.81
D = 0.2
V = Q / A
HEADLOSS = ((F * L) * (V ^ 2)) / ((2 * G) * (D ^ 4))
End Function
It works fine. But what i now need to do is make a function keeping in mind that all other variables except G can change. In the above example Q is the one which we pick up from the excel sheet. But sometimes if not Q which should be referred to, can be F also.
SO how to i put a case where i can select the Letter and that goes into the Argument and makes the rest constants in the same formula.
Can some one please help me?