I have a table which has a ToggleButton next to each line.
I would like to write a script that does something for each line of the table, but only if the ToggleButton on that line is pressed.
Is there a way to define the if condition in an elegant way?
I would imagine something like:
For i = 1 To 100
if ("ToggleButton" & (i + 29)).Value = True Then
'DO SOMETHING
End If
Next i
Or:
For i = 1 To 100
if CallByName(("ToggleButton" & (i + 29)), Value, VbGet) = True Then
'DO SOMETHING
End If
Next i
Unfortunately, none of these above work and I have searched for hours trying to find a solution without having to write down 100 different button names into a collection or something...
Please help me.
I would like to write a script that does something for each line of the table, but only if the ToggleButton on that line is pressed.
Is there a way to define the if condition in an elegant way?
I would imagine something like:
For i = 1 To 100
if ("ToggleButton" & (i + 29)).Value = True Then
'DO SOMETHING
End If
Next i
Or:
For i = 1 To 100
if CallByName(("ToggleButton" & (i + 29)), Value, VbGet) = True Then
'DO SOMETHING
End If
Next i
Unfortunately, none of these above work and I have searched for hours trying to find a solution without having to write down 100 different button names into a collection or something...
Please help me.