title: How to pass array data such as A1:A500 into a Excel user defined function
body: <p>I am attempting to pass a variable array into an excel user-defined function. My Excel VBA is attached below and I 'm hoping I can pass a range such as A1: A100 into the current variable Data and then manipulate it like a normal excel formula.Any help would be greatly appreciated.</p>
  
  <pre><code> Function LowerB_4n_2(inputrange As Range) As Double
   Dim myArray As Variant
   Data = inputrange.Value
   LowerB_4n_2 = Small(Data, (Round((((0.4 * (Count(Data))) - 2)), 0)))
   End Function
  
   Function UpperB_4n_2(inputrange As Range) As Double
   Dim myArray As Variant
   Data = inputrange.Value
   UpperB_4n_2 = Large(Data, (Round((((0.4 * Count(Data)) - 2)), 0)))
   End Function
  
   Function Width4n_2(inputrange As Range) As Double
   Dim myArray As Variant
   Data = inputrange.Value
    Width4n_2 = (Large(Data, (Round((((0.4 * Count(Data)) - 2)), 0))) - 
    (Small(Data, (Round((((0.4 * Count(Data)) - 2)), 0)))))
  
    End Function
  </code></pre>