Loops HELP
-
I've got a bunch of check boxes that all do the same piece of code except for one word. If the check box is checked they run: command = "net send " checkbox.caption & txtBox.text the checkbox.caption needs to equal the caption of the check box if it's checked. I was thinking about using control arrays and doing something like this: For Each value In Checkbox(x) command = "net send " checkbox.caption & txtBox.text Next HELP
-
I've got a bunch of check boxes that all do the same piece of code except for one word. If the check box is checked they run: command = "net send " checkbox.caption & txtBox.text the checkbox.caption needs to equal the caption of the check box if it's checked. I was thinking about using control arrays and doing something like this: For Each value In Checkbox(x) command = "net send " checkbox.caption & txtBox.text Next HELP
If you absolutely have to store your commands in the Caption property of your checkboxes, you could do something like this: For i = 1 To Check1().UBound + 1 Debug.Print Check1(i - 1).Caption & ":" & CStr(Check1(i - 1).Value) If Check1(i -1).Value = 1 Then commandLine = "net send " & Check1(i - 1).Caption End If Next