smittal
Member
Hi all,
can anyone suggest the VBA code to create a loop depend on check box value. what exactly i want...
There are 50 check boxes on a sheet.. for true value of each check box its corresponding cell text get uploaded in db..as like
If .CheckBox1.Value = True Then
rs("Task_Desc") = Sheet4.Range("B37")
rs("Delivery_dt") = Sheet4.Range("G37")
rs.Update
rs.AddNew
End If
If .CheckBox2.Value = True Then
rs("Task_Desc") = Sheet4.Range("B38")
rs("Delivery_dt") = Sheet4.Range("G38")
rs.Update
rs.AddNew
End If
If .CheckBox3.Value = True Then
rs("Task_Desc") = Sheet4.Range("B39")
rs("Delivery_dt") = Sheet4.Range("G39")
rs.Update
rs.AddNew
End If.......
i don't want to repeat the same code at n times for n number of check box value
Many thanks in advance for same....
can anyone suggest the VBA code to create a loop depend on check box value. what exactly i want...
There are 50 check boxes on a sheet.. for true value of each check box its corresponding cell text get uploaded in db..as like
If .CheckBox1.Value = True Then
rs("Task_Desc") = Sheet4.Range("B37")
rs("Delivery_dt") = Sheet4.Range("G37")
rs.Update
rs.AddNew
End If
If .CheckBox2.Value = True Then
rs("Task_Desc") = Sheet4.Range("B38")
rs("Delivery_dt") = Sheet4.Range("G38")
rs.Update
rs.AddNew
End If
If .CheckBox3.Value = True Then
rs("Task_Desc") = Sheet4.Range("B39")
rs("Delivery_dt") = Sheet4.Range("G39")
rs.Update
rs.AddNew
End If.......
i don't want to repeat the same code at n times for n number of check box value
Many thanks in advance for same....