C
Christopher A. Kelly
I'm trying to determine what type of park the different National Parks are
using the following function. obvisously i'm doing something wrong. in the
formula bar i entered =CalcValue(c2) but it returns #value.
Module1->
Function CalcValue(MyCell as String) As String
If InStr(0, MyCell, "National Park") Then
CalcValue = "NP"
ElseIf InStr(0, MyCell, "Historic") Then
CalcValue = "HP"
ElseIf InStr(0, MyCell, "Military") Then
CalcValue = "MP"
ElseIf InStr(0, MyCell, "Preserve") Then
CalcValue = "NPRE"
ElseIf InStr(0, MyCell, "Monument") Then
CalcValue = "NM"
ElseIf InStr(0, MyCell, "Memorial") Then
CalcValue = "NM"
ElseIf InStr(0, MyCell, "Senic") Then
CalcValue = "NS"
ElseIf InStr(0, MyCell, "Recreation") Then
CalcValue = "NR"
Else
CalcValue = "0"
End If
End Function
using the following function. obvisously i'm doing something wrong. in the
formula bar i entered =CalcValue(c2) but it returns #value.
Module1->
Function CalcValue(MyCell as String) As String
If InStr(0, MyCell, "National Park") Then
CalcValue = "NP"
ElseIf InStr(0, MyCell, "Historic") Then
CalcValue = "HP"
ElseIf InStr(0, MyCell, "Military") Then
CalcValue = "MP"
ElseIf InStr(0, MyCell, "Preserve") Then
CalcValue = "NPRE"
ElseIf InStr(0, MyCell, "Monument") Then
CalcValue = "NM"
ElseIf InStr(0, MyCell, "Memorial") Then
CalcValue = "NM"
ElseIf InStr(0, MyCell, "Senic") Then
CalcValue = "NS"
ElseIf InStr(0, MyCell, "Recreation") Then
CalcValue = "NR"
Else
CalcValue = "0"
End If
End Function