why don't these loops work?
why don't these loops work?
(OP)
Sub zerotest()
Dim seekValue As Double
Dim changeCell As Range
Inflation = Range("O7").Value
seekValue = 12345
'seekValue = InputBox("What's the value to seek?")
For Each changeCell In Range("N14:N32").Cells
'Do Until changeCell < 10
changeCell.GoalSeek Goal:=seekValue, changingCell:=changeCell.Offset(0, -4)
'Do Until changeCell < 10
' Loop
seekValue = seekValue + (seekValue * Inflation)
' Loop
Next changeCell
End Sub
yes i know they are commented out.
but how do i limit the value to 10 or more?
thanks
Dim seekValue As Double
Dim changeCell As Range
Inflation = Range("O7").Value
seekValue = 12345
'seekValue = InputBox("What's the value to seek?")
For Each changeCell In Range("N14:N32").Cells
'Do Until changeCell < 10
changeCell.GoalSeek Goal:=seekValue, changingCell:=changeCell.Offset(0, -4)
'Do Until changeCell < 10
' Loop
seekValue = seekValue + (seekValue * Inflation)
' Loop
Next changeCell
End Sub
yes i know they are commented out.
but how do i limit the value to 10 or more?
thanks





RE: why don't these loops work?
For changeCell = 1 To 10
changeCell.GoalSeek Goal:=seekValue, changingCell:=changeCell.Offset(0, -4)
seekValue = seekValue + (seekValue * Inflation)
End For
Cyril Guichard
Defense Program Manager
Belgium
RE: why don't these loops work?
Do Until changeCell < 10
is saying do the code until the value of changeCell is less than 10.
Try
Do Until changeCell > 10
RE: why don't these loops work?
CODE