Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following macro was working to solve for face. But in case the solver
couldn't determine the face amount - I wanted to handle this error message. Solver can get the correct face amount - however it will still display the message box. What am I doing wrong?? Sub Solve_for_Face() Dim cntr As Integer If shtSolve.Range("z19").Value < 5000 Then shtSolve.Range("z19").Value = 5000 End If shtSolve.Range("aa25").GoalSeek Goal:=shtSolve.Range("aa26"), _ ChangingCell:=shtSolve.Range("z19") Do On Error GoTo newprem shtSolve.Range("z19").Value = Round(shtSolve.Range("z19").Value, 3) + 0.001 Loop Until shtSolve.Range("aa25").Value shtSolve.Range("aa26").Value shtSolve.Range("z19").Value = shtSolve.Range("z19").Value - 0.001 shtSummary.Range("UnitAmt") = Int(shtSolve.Range("z19") * 1000) shtSummary.Range("UnitADB") = Int(shtSolve.Range("z21") * 1000) Exit Sub newprem: MsgBox "cannot solve for face enter different premium" End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro not working correctly | Excel Programming | |||
Macro suffers from premature exiting | Excel Programming | |||
Macro not calculating correctly | Excel Programming | |||
Macro Fails to Run Correctly | Excel Programming | |||
Exiting a VBA Macro by user intervention | Excel Programming |