I am trying to run some macros based on whether or not a radio button is selected. I am using a For Loop to do this, but cannot figure out how to reference the button based on where its name is indexed in an array of arrays which contain references to reports, buttons, and sheet names. Here is my code:
The debugger highlights If Sheets("REPORT").reportList(i)(0).Value = True Then and states "object doesn't support this property or method." I'm assuming that reportList(i)(0) is the problem, but cannot figure out how to properly reference it.
Thanks
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
Application.Run reportList(i)(1) 'This might be helpful -https://stackoverflow.com/questions/15969796/call-a-sub-with-a-string
'
End If
Next i
The debugger highlights If Sheets("REPORT").reportList(i)(0).Value = True Then and states "object doesn't support this property or method." I'm assuming that reportList(i)(0) is the problem, but cannot figure out how to properly reference it.
Thanks