VB-ITERATION
VB-ITERATION
(OP)
How do I stop AN iteration when it reaches the end of a group of occupied cells filled with the IDENTICAL text (i.e. B277) in a column?
I want it to stop at the end of the list. HOW does it know that the next
cell is empty so it will not error or use an empty cell.
the length of the list in a column or number of rows varies for different
groups that the routine or loop neet to operate on. thank you for your help.
I know there is a way of doing.
I want it to stop at the end of the list. HOW does it know that the next
cell is empty so it will not error or use an empty cell.
the length of the list in a column or number of rows varies for different
groups that the routine or loop neet to operate on. thank you for your help.
I know there is a way of doing.





RE: VB-ITERATION
THANKS A LOT
RE: VB-ITERATION
CODE
a = 1
Do While ActiveSheet.Cells(a, 1) = "b277"
Cells(a, 2) = a ' or do whatever you need here
a = a + 1
Loop
MsgBox a - 1 & " Cells affected"
End Sub
The example starts looking at A1 and goes down until the cell value changes. Change the initial value of a to start at a different row. The second value in the first Cells function (1 in this case) sets the column to search
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
UK steam enthusiasts: www.essexsteam.co.uk
RE: VB-ITERATION
it worked good
RE: VB-ITERATION