Looping through checkboxes

T

TomK76

I have a macro that has a pair of loops in it. I have inserted checkboxes
into the sheet to enable the user to skip certain lines when the macro runs.
The problem is I have Checkbox1, checkbox2, and so on.

For myLine = 1 To 5

If Sheet1.Checkbox1 = True Then

myPath = dirPath & ... & mySheet & "'!E24"

ActiveCell.Value = "='" & myPath

Cells(ActiveCell.Row + 1, 2).Select

Else

Cells(ActiveCell.Row + 1, 2).Select

End If

Next myLine

I want to use the "myLine" counter in the loop to check each checkbox for
the True condition.

I am sure there is a simple way, I just cannot seem to figure it out. Any
help would be appreciated. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top