looping through variable defined cell addys

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to write some code that will use for/next to evaluate cell values
in the same row one cell at a time. I cant figure out how to name the cell
addresses programatically.
I want it to go through row 10 until it finds an empty cell, my code is
probably flawed in many ways:

For col = 3 To 21 Step 1
CellAddy = col & "10"
Range(CellAddy).Select
If cellvalue <> "" Then
Num = Num + 1
Else
messagebox.show(Num &"is the number")
End If
Next col

Please point me to the proper way to do this.
 
If isempty(cells(10,3)) then
set rng = cells(10,3)
else
set rng = cells(10,3).End(xltoRight)
if rng.column > 21 then
msgbox "All Full"
exit sub
end if
End if
msgbox rng.Address
 
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
 

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

Back
Top