add Volatile property to your function so it will recalculate, everytime you change anything:

Function egesz(S0, alfa, szigma, N, yf, DB, IMR, MMR)
    Application.Volatile
    ...   ' rest of code
    ...