UPDATE: I got the code to do exactly what I wanted it to do (pasted below), although some may probably disagree with my method (and I'll take feedback because I am 100% new to this).
I am trying to create a simple VBA code to run a loop with an if then statement -and if the statement is true then stop the loop. If the statement is never true until the end, then stop the loop when cell is IsEmpty().
This is what I have so far. It is obviously incorrect and it is not running, but I hope this attempt will help you grasp an idea of what I'm trying to do.
Sub runoutDateLoop()
r = 8
Do Until IsEmpty(Cells(r, 1))
c = 24
Do Until Cells(r, c - 1).Value < 1 = True
If Cells(r, c).Value < 1 Then
Cells(r, 18).Value = Cells(7, c)
Else
Cells(r, 18).Value = Cells(7, c)
End If
c = c + 1
Loop
r = r + 1
Loop
End Sub
I am trying to create a loop until the if statement is true. The if then statement is simply- if the number is a negative number, then we want cell r,18 to copy to cell 7,c. If not, then the loop occurs until there is a negative number OR if there is never a negative number, then until the cell is empty. I want this to also have a double Do Until loop with every row.
Anyone have any ideas please??
Thank you!