I have made this custom function to check cells B4-B8 to see that they are Numeric. My goal is to use this function in worksheet formulas.
I would like to access this function in my formula via an "if then" statement, i.e. "=if(VCDataNumeric=true,"Do this", "Do that")"
That is my ultimate goal, and not sure how to get it to work correctly. Any pointers would be great!
Code:
Function VCDataNumeric() As Boolean
' Determines if all entered data in VC boxes are NUMERIC
' Returns TRUE if all inputs are NUMERIC
Dim PVIstation As Double: PVIstation = Range("B4").Value
Dim PVIelevation As Double: PVIelevation = Range("B5").Value
Dim VClength As Double: VClength = Range("B6").Value
Dim g1 As Double: g1 = Range("B7").Value
Dim g2 As Double: g2 = Range("B8").Value
If IsNumeric(PVIstation) And IsNumeric(PVIelevation) And IsNumeric(VClength) And IsNumeric(g1) And IsNumeric(g2) Then VCDataNumeric = True
Else
VCDataNumeric = False
End If
End Function