I have a Do until statement wrapped in an If statement and this is the Do until code I am using:
I have a range of Numbers in Column A and a number in C1. I want to increase the value in a cell C1 by 1 until the value in C1 is not found with in my specified range. When I run the Macro, it just keeps looping, somehow I have created a continuous loop.
If anyone can help me figure out how to accomplish my goal, I would be extremely grateful
Code:
DEPI = Sheets("MTN").Range("A1").End(xlDown).row Set findrange = Sheets("MTN").Range("A1:A" & DEPI)
Set foundcell = findrange.Find(What:=Sheets("MTN").Range("C1").Value, LookIn:=xlValues, LookAt:=xlWhole)
Do Until foundcell Is Nothing
Sheets("MTN").Range("C1").Value = Sheets("MTN").Range("C1").Value + 1
Loop
I have a range of Numbers in Column A and a number in C1. I want to increase the value in a cell C1 by 1 until the value in C1 is not found with in my specified range. When I run the Macro, it just keeps looping, somehow I have created a continuous loop.
If anyone can help me figure out how to accomplish my goal, I would be extremely grateful