Put the following code in a macro that calls another workbook:
Location = Worksheets("Main").Range("folder_location").Value Set wb = Workbooks.Open(Location & Range("fv_file").Value) Application.Run "'" & wb.Name & "'!" & strSubToRun, Parameters Set wb = Nothing
Parameters is an array of arguments that you want to pass, so the sub in another book should look something like this:
Public Sub TheSub(ParamArray X()) Dim i As Long Sheet1.Cells(1, 1).Value = "Parameters passed:" For i = 0 To UBound(X(0)) Sheet1.Cells(i + 2, 1).Value = CStr(X(i)) Next End Sub
source share