For Each c In rng.Cells If c.Value = "X" Or c.Value = "x" Then CallByName myReportGenerator, "GenerateReport", vbMethod, c.Offset(0, 1).Value End If Next
Note. I assume that myReportGenerator is an instance of a class that contains a GenerateReport method that takes 1 parameter.
EDIT . If it works with you, put the functions inside the sheet (say Sheet1 ).
CallByName Sheet1, c.Offset(0, 1).Value, vbMethod
It is assumed that c.Offset(0, 1).Value contains the method name, which is the public method inside Sheet1 .
EDIT2 . Suppose you put these methods inside a class called class1 . Here is what you will do
dim reportHelper as Class1 set reportHelper = new Class1 CallByName reportHelper, c.Offset(0, 1).Value, vbMethod
source share