I have an array of arrays and am trying to cycle through it and run macros based on the index in the array. My code is as follows
The debugger is highlighting Call reportList(i)(1) between the i and the 1 and saying:
Compile Error: Expected end of statement
The items in the array are as follows
Index 0 - name of a radio button
index 1 - name of a macro that creates a report
index 2 - name of the report that it will eventually create
Right now I am trying to get the For Loop to run the macro at the index in reportList
Any insight would be appreciated
VBA Code:
Dim reportList As Variant
'sheet, button, report
reportList = Array( _
Array("scpSumBox", "RPscopeOfWorkSummary", "Scope of Work Summary"), _
Array("prpSumBox", "RPprpFixtures", "Proposed Fixture Summary"), _
Array("exstSumBox", "RPexistingFixtures", "Existing Fixture Summary") _
)
'Cycle through list and create reports
For i = 0 To UBound(reportList)
If Sheets("REPORT").reportList(i)(0).Value = True Then
Call reportList(i)(1)
End If
Next i
The debugger is highlighting Call reportList(i)(1) between the i and the 1 and saying:
Compile Error: Expected end of statement
The items in the array are as follows
Index 0 - name of a radio button
index 1 - name of a macro that creates a report
index 2 - name of the report that it will eventually create
Right now I am trying to get the For Loop to run the macro at the index in reportList
Any insight would be appreciated