Using a variable for Index
Dim iLoop As Long
For iLoop = 1 To TotalNumOptFeatures
CheckBox("Index = iLoop").Click
I'm having a problem with the above code. It gives a type mismatch error. I have several places in my code where I want to use a variable for the index. Unfortunatly, the help files don't really give a good example of a variable index. I've tried putting single quoutes around the variable but that didn't help. Any suggestions would be greatly appreciated. Thanks.
Re: Using a variable for Index
You need to separate iLoop from the CheckBox.Click like this...
CheckBox("Index = " & iLoop).Click
Because iLoop is inside the quotes, it becomes a literal string. So Index is literally set to the term "iLoop".
Hope this helps,