ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   looping through variable defined cell (https://www.excelbanter.com/excel-programming/372422-re-looping-through-variable-defined-cell.html)

[email protected]

looping through variable defined cell
 
Hi,

Can someone help me with this code....I want to loop through the
worksheet and place a check in all ( checkbox in column B) when column
C Row is blank I want the loop to stop.

It only checked the first checkbox and stopped.... I can send you a
sample worksheet if you would give me your email address.....I am not
able to send you an attached file in this forum.

I want it to go through row 66 until it finds an empty cell, my code is
probably flawed in many ways:

Please point me to the proper way to do this.

I have a sample file I can send to anyone if I can get an email
address.

Thanks

Public Sub CommandButton1_Click()
Dim CB As Variant
Dim iRow As Integer
iRow = 1

For Each CB In ActiveSheet.CheckBoxes
If Cells(iRow, "C").Value < "" Then
CB.Value = True
Else
Exit Sub
End If
iRow = iRow + 1
Next
End Sub



All times are GMT +1. The time now is 01:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com