title: Updating a global array
body: <p>I am unable to update a global string array with excel vba ,though I am aware  it is not the ideal way to write code.
  I have simplified my requirement and here is code where I want to write values like A0,A1,A2,...  to an array . 
  I am calling the Function Getone twice to simulate a case where it will be called from another Function multiple times</p>
  
  <p>But unlike a global integer  -arrind , I am not able to update the Global string ,lsatest</p>
  
  <p>I have declared lsatest in Module level too
  I tried with  lsatest as Variant too 
  I always get blank for second message box . 
  what is mistake i am doing ?</p>
  
  <pre><code>Option Explicit
  Dim arrind As Integer
  Public lsatest As String
  
  
  Private Sub CommandButton1_Click()
  
  arrind = 0
  MsgBox (Getone)
  ' got A1 and thats right
  
  MsgBox (Getone)
  ' expecetd A1 got blank
  
  
  End Sub
  
  
  
  Public Function Getone() As String
  
  Dim k As Integer
  Dim lsatest()
  For k = 0 To 2
  ReDim Preserve lsatest(arrind)
  lsatest(arrind) = "A" &amp; arrind
  arrind = arrind + 1
  Next k
  Getone = lsatest(1)
  
  End Function
  </code></pre>
  
  <p>Thanks</p>