title: VB Type Mismatch 'Return'
body: <p>I want to use a function to return a string however, I keep getting a Type mismatch 'Return' error.</p>
  
  <p>Any help would be much appreciated.</p>
  
  <pre><code>Dim myvar
  myvar = getMultiLineString()
  MsgBox(myvar)
  
  Function getMultiLineString()
  
      Dim a(3)
      Dim i
      Dim query
  
      a(1)   = "test line 1"
      a(2)   = "test line 2"
      a(3)   = "test line 3"
  
      query = a(1)
  
      For i=2 to 3
          query = query &amp; VbCrLf &amp;  a(i)
      next
  
      MsgBox(query)
      Return query
  
  End Function
  </code></pre>