I have very moderate experience with coding; and here is my task. I need to check for first 4 characters of a string in a cell and conditionally enter a string in an adjacent cell. My function looks like this:
[vba] Dim Co As String
Function ResolveCo(pVal As String) As String
Co = Left(pVal, 4)
If Co = "ZAAL" Then
ResolveCo = "Value1"
ElseIf Co = "ZARK" Then
ResolveCo = "Value2"
Else
ResolveCo = "Value3"
End If
End Function
[/vba]
Then in a C2 cell i call this functions like this:
[vba] =ResolveCo(B2) [/vba]
On one XP computer with Office 2003 I am not getting any error handling, the cell just results in #Name?; same on another Vista machine with 2007 Yet on another XP machine I am also getting the "Cannot fine Project or Library" message; yet there are no MISSING flags in the list of libraries.
What am I doing wrong?