Hello

I have a minor problem that I really hope one of you can help me with.

Through a "problem solver process" in VBA I get some values that I want to insert in certain cells. The code is below (I am not giving the entire code as that seems to be unnecessary)

ans = MsgBox("best solution found: RI = " & DBest & " given by i = " & iBest & " and j = " & jBest & vbNewLine _
& vbNewLine & "Do you want to insert the found values in the sheet?", vbYesNo)

If ans = vbNo Then
Exit Sub

ElseIf ans = vbYes Then
Range("c2").Value = iBest
Range("c3").Value = jBest
End If

Application.ScreenUpdating = True

End Sub
Problem is that nothing changes when I press yes in the messagebox? (even though the messagebox did say that optimal values were found)...