我不确定如何或是否可以做到这一点......我想使用“ap1”构建函数名称,我可以这样做,但我收到“预期数组”错误。想法?我已经盯着这个太久了。
这是一段代码:
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 & "_AddPort"
For Each ap In newrange
If ap > 0 Then
newnum0 = ap
ap = ap1(newnum0) 'Here's the problem
ap.Value = newnum0
End If
Next ap
End if