Okay, I found two problems.
Try:
Private Sub Worksheet_Change(ByVal Target As Range)
If Sheet3.Range("$G$11").Value = "Fixed" Then
Dim dbLauter As Double
Dim dbSparge As Double
Dim dbElse As Double
Dim db As Double
Application.EnableEvents = False
dbLauter = Format(Sheet11.Range("$Z$37").Value, "#.00")
dbSparge = Format(Sheet11.Range("$Z$35").Value, "#.00")
dbElse = Format(Sheet11.Range("$Z$41").Value, "#.000")
db = Sheet11.Range("$Z$37")
Do While (Round(db, 3) <> Round(dbSparge, 3))
If Sheet11.Range("$Z$37") > dbSparge Then
Sheet11.Range("$FO$503") = Sheet11.Range("$FO$503") - 0.001
End If
If Sheet11.Range("$Z$37") < dbSparge Then
Sheet11.Range("$FO$503") = Sheet11.Range("$FO$503") + 0.001
End If
'Sheet11.Range("$FO$503") = Format(dbElse, "#.000")
db = Sheet11.Range("$Z$37")
Loop
Else
Sheet11.Range("$FO$503") = CDbl(Sheet11.Range("$Z$41").Value)
End If
Application.EnableEvents = True
End Sub
Problem #1: You are adding/subtracting 0.001, so you need to round to 3 digits (not two).
Problem #2: You are using a "Change" function and writing (aka changing!!) the same sheet where the "Change" function exists. Thus it is looping again and again because you are changing it again and again. The solution is to turn off Enable Events while the function runs.
I added: db = Sheet11.Range("$Z$37") so I could see what was going on. Once everything is working, you can delete the db variable and put it back as it was (if you want).
Since I don't know what your code is supposed to do, I don't know if it is now working. But at least is it no longer going into an endless loop.
P.S. In VBA you don't need the dollar sign when working with Range variables.
Bookmarks