help you fix your problem The answer is what Magnus already stated: Yes, it is a normal behavior. Range loops are for cases when we are interested in examining every item in a collection (unless we break out sooner) and aren't interested in doing anything with the container itself. Like it was already stated, range loops are optimized that way, e.g. it indeed computes the finishing condition only once. In my opinion, this is a very nice and welcome addition to the variety of loop options in c++, since we do often face this very exact situation: we get a container and are interested in simply going through them one by one in either const or non-const fashion.
VBA loop through range and output if complete range is empty
Hope that helps I have searched a lot about my question but could not find the answer I need. , Your are doing well. Just need to loop thru the range like this.
Dim rng As Range, r As Range
Set rng = Range("B2:DT97138")
For Each r In rng.Rows
If WorksheetFunction.CountA(r) = 0 Then
Cells(r.Row, 125) = "Empty"
Cells(r.Row, 125) = "Not Empty"
Scenario output gives wrong answer upon second loop
wish help you to fix your issue While this may not completely fix your issue, you need to at least reinitialize your volFilled value back to 0.0 between scenarios. Otherwise you're just continuing from the previous scenario's volFilled, and that explains why the second test that you did with switching the scenarios yielded the same output. After the first scenario where volFilled reaches 20.0, it won't execute the logic inside the considion while (volFilled < V) in the second scenario because at this point, volFilled = 20 while V = 10.
C++ range for loop different than regular for loop