G
Guest
Help urgently needed for this:
Sub x()
Dim a As String
Dim b As Variant
ReDim b(1 To 2, 1 To 1)
b(1, 1) = 1
b(2, 1) = 2
a = "Sum"
'This Works fine: "3"
MsgBox WorksheetFunction.Sum(b)
'This does not work: "WorksheetFunction.Sum(b)"
'I need to "force" an evaluation of the expression "WorksheetFunction.Sum(b)"
MsgBox "WorksheetFunction." & a & "(b)"
End Sub
Thanks a lot in advance !
Sub x()
Dim a As String
Dim b As Variant
ReDim b(1 To 2, 1 To 1)
b(1, 1) = 1
b(2, 1) = 2
a = "Sum"
'This Works fine: "3"
MsgBox WorksheetFunction.Sum(b)
'This does not work: "WorksheetFunction.Sum(b)"
'I need to "force" an evaluation of the expression "WorksheetFunction.Sum(b)"
MsgBox "WorksheetFunction." & a & "(b)"
End Sub
Thanks a lot in advance !