In VBA Code, I am trying to insert values for an entire column, but I want to stop inputting values with the last cell that has a value.
For Each Cell In Range(addedCell.Offset(1, 0), addedCell.Offset.End(xlDown))
Cell = UpdateCells(Cell.Offset(0, -1))
Next Cell
The above code populates a value for the entire column but I want the sub to stop at the last cell with a value in the column. How can I code for that?
Dear,
I may need more information to provide you a simple code for your objective, If you can help me with your scope and what you want to achieve with this code. Still as per the description what I got is, you want to stop loop on any condition, you can try putting an IF within loop.
A detailed clarification or understanding will be help, to complete the code.
For Each Cell In Range(addedCell.Offset(1, 0), addedCell.Offset.End(xlDown))
If Cell <> "" Then
Cell = UpdateCells(Cell.Offset(0, -1))
End If
Next Cell
OR
Get Answers For Free
Most questions answered within 1 hours.