title: VBA/Excel error - Error in value when using StartsWith
body: <p>The function below prints value South when I call =LRegionName(cell) from excel when the value of the cell is S. But when the value of the cell is N it gives Error in Value in excel. What am I missing?</p>
  
  <pre><code>Function LRegionName(LRegion)
  If LRegion = "S" Then
     LRegionName = "South"
  ElseIf LRegion.startsWith("N") Then
      LRegionName = "North"
  ElseIf LRegion = "E" Then
     LRegionName = "East"
  ElseIf LRegion = "W" Then
     LRegionName = "West"
  Else
     LRegionName = "Dont know"
  End If
  
  End Function
  </code></pre>