ich hoffe, die Überschrift beschreibt das Problem einigermaßen... :)
Ich möchte verschiedene Functions aufrufen, deren Namen in einem Array gespeichert sind. Leider ist mir die VBA-Hilfe keine Hilfe und nun hoffe ich auf euch! Desweiteren muss ich Variablen übergeben.
Ich habe einen kleinen Beispielcode geschrieben, um das Problem zu verdeutlichen:
Option Explicit
Dim a As Double
Dim b As Double
Public Sub Hallo()
Dim strName(2) As String
Dim c As Long
a = 1
b = 2
strName(0) = "test1"
strName(1) = "test2"
strName(2) = "test3"
For c = 0 To UBound(strName)
call strname(c) (a,b)
Next c
End Sub
' RECIKAPPA, CWPIRG,KFMIOP
Private Function test1(ByVal a1 As Double, ByVal b1 As Double) As Double
test1 = a1 + b1
End Function
Private Sub test2(ByVal a2 As Double, ByVal b2 As Double)
MsgBox (a2 & " " & b2)
End Sub
Private Sub test3(ByVal a3 As Double, ByVal b3 As Double)
a3 = a3 + b3
MsgBox (a3)
End Sub
Ich hoffe, ihr könnt mir bei dem Problem helfen!
Danke und Gruß
Micha