mole999
Well-known Member
- Joined
- Oct 23, 2004
- Messages
- 10,524
- Office Version
- 2019
- 2016
- 2013
- Platform
- Windows
I have a long list of check, change/replace items. once the values for N have been found has been updated I want to leave the NEXT loop and restart the search on the next number, and for the life of me I can't find a way that will restart the search with an increment
What did I miss (tried Next N / Goto I different varieties)
What did I miss (tried Next N / Goto I different varieties)
Code:
For N = 1 to 500 STEP 1
With Sheets("Master Streets")
If .Range("AG" & N) = "" _
And .Range("S" & N) = "+" Or .Range("S" & N) = "+" Or .Range("S" & N) = "+" _
Or .Range("S" & N) = "+" Or .Range("S" & N) = "+" _
Then _
.Range("U" & N) = "road": _
.Range("Y" & N) = "postcode": _
.Range("AG" & N) = "map": _
.Range("AH" & N) = "E": _
.Range("AI" & N) = "N": _
.Range("S" & N) = "final ID"
DoEvents
[COLOR=#FF0000]Found this one so force the next loop to start rather than test every other With / End With before looping again[/COLOR]
End With
With Sheets("Master Streets")
If .Range("AG" & N) = "" _
And .Range("S" & N) = "+" Or .Range("S" & N) = "+" Or .Range("S" & N) = "+" _
Or .Range("S" & N) = "+" Or .Range("S" & N) = "+" _
Then _
.Range("U" & N) = "road": _
.Range("Y" & N) = "postcode": _
.Range("AG" & N) = "map": _
.Range("AH" & N) = "E": _
.Range("AI" & N) = "N": _
.Range("S" & N) = "final ID"
DoEvents
End With
Next N