title: VBA pass the name of activesheet to a function
body: <p>I have created a function to receive three parameters.:</p>
  
  <ul>
  <li>An array of strings</li>
  <li>A worksheet name</li>
  <li>An index for the array of strings</li>
  </ul>
  
  <p>When I compile I am getting a compile error stating:</p>
  
  <p>Compile Error:
  Expected:=</p>
  
  <p>My call is:</p>
  
  <pre><code>Sub C_Button_ImportBOM_Click()
  
    Dim strFilePathName As String
    Dim strFileLine As String
    Dim v As Variant
    Dim RowIndex As Long
    Dim mySheet As Worksheet
  
    ActiveSheet.Name = "Import"
  
    mySheet = Worksheets("Import")
  
    strFilePathName = ImportFilePicker
  
    v = QuickRead(strFilePathName)
    For RowIndex = 0 To UBound(v)
      PopulateNewLine (v(RowIndex), mySheet, RowIndex)
    Next
  
  End Sub
  </code></pre>
  
  <p>The function declaration is:</p>
  
  <pre><code>Function PopulateNewLine(SourceString As String, ImportSheet As Worksheet, CurrentRow As Long)
  </code></pre>
  
  <p>I have tried many things to no avail. Initially with just the first argument declared and used this worked okay.</p>
  
  <p>Any ideas greatly appreciated.</p>
  
  <p>Excel 2010 VBA</p>