VBA MOD01 Next Counter Loop
● Simple For…Next to conditionally add values (10) to Quantities greater than 400
Public Sub Simple_For()
Dim i As Long
Dim lastrow As Long
Dim myValue As Double
Const StartRow As Byte = 10
lastrow = Range("A" & StartRow).End(xlDown).Row
For i = StartRow To lastrow
myValue = Range("F" & i).Value
If myValue > 400 Then Range("F" & i).Value = Range("F" & i).Value + 10
If myValue < 0 Then Exit For
Next i
End Sub
Comments
Post a Comment