title: how to remove the argument not optional error
body: <p>i want to call the function vector in the sub.but when i run it it gives error argument not optional and highlights vector.what should i do </p>
  
  <pre><code>Option Explicit
  Option Base 1
  
  Sub JumbleArray()
  Dim n As Integer, rng As Range, Z As Variant, rn As Integer, tem As Integer, j As Integer
  Dim k As Integer
  Set rng = Range("A1:C3")
  **Z = myfunction(vector)**
  For j = 1 To n
      rn = WorksheetFunction.RandBetween(1, n - j + 1)
      tem = Z(n - j + 1)
      Z(n - j + 1) = Z(rn)
      Z(rn) = tem
  Next j
  End Sub
  Function vector(rng As Range)
  Dim nr As Integer, nc As Integer, i As Integer, j As Integer, temp()
  nr = rng.Rows.Count
  nc = rng.Columns.Count
  ReDim temp(nr * nc)
  For i = 1 To nr
      For j = 0 To nc - 1
      temp((j * nr) + i) = rng.Cells(i, j + 1)
      Next j
  Next i
  temp = WorksheetFunction.Transpose(temp)
  vector = temp
  End Function
  </code></pre>