P Peter Feb 23, 2004 #1 Can anyone help with a piece of Code that will recalc the sheet until a certain cell contains a certain value e.g.:- A1 = 0 TIA Peter
Can anyone help with a piece of Code that will recalc the sheet until a certain cell contains a certain value e.g.:- A1 = 0 TIA Peter
J JE McGimpsey Feb 23, 2004 #2 One way: Do Until Range("A1").Value = 0 ActiveSheet.Calculate Loop Note that this is a dangerous piece of code since nothing internal to the loop changes A1. Also, rounding errors can sometimes make even proper loops fail. Better might be: Const epsilon As double = 1E-10 Do Until Abs(Range("A1").Value < epsilon ActiveSheet.Calculate Loop
One way: Do Until Range("A1").Value = 0 ActiveSheet.Calculate Loop Note that this is a dangerous piece of code since nothing internal to the loop changes A1. Also, rounding errors can sometimes make even proper loops fail. Better might be: Const epsilon As double = 1E-10 Do Until Abs(Range("A1").Value < epsilon ActiveSheet.Calculate Loop
R Rob van Gelder Feb 23, 2004 #3 You could use Goalseek or Solver unless A1 contains a function like a countdown or something?
S Serkan Feb 23, 2004 #4 This routine will do: Sub whatUneed() Application.Calculation=xlCalculationManual while cells(1,1) Application.Calculate Wend End Sub
This routine will do: Sub whatUneed() Application.Calculation=xlCalculationManual while cells(1,1) Application.Calculate Wend End Sub