title: Building a string and using it as the function array name
body: <p>I'm not sure how or if I can do this... I want to build the function name using "ap1", which I'm able to do, but I'm getting an "expected array" error.  Thoughts?  I've been staring at this too long.</p>
  
  <p>Here's the piece of code:</p>
  
  <pre><code>Dim ap As Range
  Dim newnum0 As String
  Dim ap1 As Variant
  Dim strswprog as string
  dim strswtype as string
  
  
      If strswprog = "Add PORT" Then
           ap1 = strswtype &amp; "_AddPort" 
      For Each ap In newrange
           If ap &gt; 0 Then
                newnum0 = ap
                ap = ap1(newnum0)    'Here's the problem
                ap.Value = newnum0
           End If
      Next ap
      End if
  </code></pre>