G
Guest
Hello.
I'm trying to arranje a function to perform calculations with fields ("Lot"
and "Dem") that have some empty records. For example, if "lot" is not empty
and "Dem" is empty, the result of the function should the one defined in the
function below (which doesn't work): 100.
The thing is that I can't define/recall what is inside the empty
cell/record. Is is the type of the variables which is not correct?
Can anyone help me? Thanks.
Function ILF(ParamArray Fields() As Variant)
Dim Lot As Variant
Dim Dem As Variant
If Lot = Empty Then
ILF = Empty
Else
If Dem = Empty Then
ILF = 100
Else
ILF = (100 + Lot * 10 - Dem) / (100 + Lot * 10) * 100
End If
End if
End Function
I'm trying to arranje a function to perform calculations with fields ("Lot"
and "Dem") that have some empty records. For example, if "lot" is not empty
and "Dem" is empty, the result of the function should the one defined in the
function below (which doesn't work): 100.
The thing is that I can't define/recall what is inside the empty
cell/record. Is is the type of the variables which is not correct?
Can anyone help me? Thanks.
Function ILF(ParamArray Fields() As Variant)
Dim Lot As Variant
Dim Dem As Variant
If Lot = Empty Then
ILF = Empty
Else
If Dem = Empty Then
ILF = 100
Else
ILF = (100 + Lot * 10 - Dem) / (100 + Lot * 10) * 100
End If
End if
End Function