Below is the code I am currently attempting to write. The background is I have a list of orders with other information A:J ( don't want to make a table if it can be avoided) I need the code to evaluate D2 & lr = 10 AND F2 & lr ="" (blank) then if that statement is true put "ON HOLD" into cell I2. I need this to evaluate for a variable range but then loop through the if condition to check all the rows in that variable range so the next cell to evaluate would be D3 AND F3 spit out "ON HOLD" in I3 if that is true otherwise leave blank if false .
Sub ForEach_IfAnd()
Dim cell as Range
lr = Sheets(1).Cells.Find("*", Cells(1,1), xlFormulas, xlPart, xlByRows, xlPrevious, False).Row
For each cell in Sheets(1).Range("?????" & lr)
If sheets(1).Range("D2") = 10 And Sheets(1).Range("F2") = "" _
Then
Range("I2") = "ON HOLD"
Else
Range("I2") = ""
End If
Next cell
End Sub
Sub ForEach_IfAnd()
Dim cell as Range
lr = Sheets(1).Cells.Find("*", Cells(1,1), xlFormulas, xlPart, xlByRows, xlPrevious, False).Row
For each cell in Sheets(1).Range("?????" & lr)
If sheets(1).Range("D2") = 10 And Sheets(1).Range("F2") = "" _
Then
Range("I2") = "ON HOLD"
Else
Range("I2") = ""
End If
Next cell
End Sub