RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 810
- Office Version
- 365
- Platform
- Windows
Hello all,
This is just out of curiosity, but I have a "stop" on my Do Until loop which says when A is "", stop.
It needs to run down a large list until it finds a criteria, then it saves the contents of whatever cell is in column S as a variable.
Is there a way to halt it once it finds the variable? Because according to this loop:
Even when it finds that A = PapNam and B is JGRT, and it saves the number in S as a variable for JGROI, it will still loop all the way down 1,000 papers looking for any other instances of the PapNam, even though it's already got the information needs.
Can I say for instance, Do Until Cells(ActiveCell.Row, "A").Value = "" or Variables = Filled
Cheers
This is just out of curiosity, but I have a "stop" on my Do Until loop which says when A is "", stop.
It needs to run down a large list until it finds a criteria, then it saves the contents of whatever cell is in column S as a variable.
Is there a way to halt it once it finds the variable? Because according to this loop:
Code:
Do Until Cells(ActiveCell.Row, "A").Value = "" If Cells(ActiveCell.Row, "A").Value = PapNam Then
If Cells(ActiveCell.Row, "B") = "JGRT" Then
JGROI = Cells(ActiveCell.Row, "S").Value
Else
OMROI = Cells(ActiveCell.Row, "S").Value
End If
End If
ActiveCell.Offset(1, 0).Activate
Loop
Even when it finds that A = PapNam and B is JGRT, and it saves the number in S as a variable for JGROI, it will still loop all the way down 1,000 papers looking for any other instances of the PapNam, even though it's already got the information needs.
Can I say for instance, Do Until Cells(ActiveCell.Row, "A").Value = "" or Variables = Filled
Cheers