View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Fortune Fortune is offline
external usenet poster
 
Posts: 7
Default Why does this code not get updated

I have got a code which needs to be updated across 19 services for each
of the three different sites. But the code gets intrrupted as soon as
it finishes when i-1 and j=1 and then we need to click to resume button
to go to 1=1, j=2. Can anyone tell me what needs to be done to update
it for all the three sites and the 19 services as well.


Sub UPDATING()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
stepsize = 100
For i = 1 To 4
For j = 1 To 19
PasteRes = "ResultsPaste" & i
Range("HospitalInUSe") = i
Range("ServiceInUse") = j
If Range("TOTALCOSTS") 1 Then
Range("TargetCell1").GoalSeek Goal:=Range("TargetValue1"),
ChangingCell:=Range("ChangeCell1")
Else
Range("ChangeCell1") = 0
End If
If Range("Reducer") = "no" And Range("ChangeCell1") < 0 Then
Range("ChangeCell") = 0
Calculate
Range("CalcResults").Copy
Range(PasteRes).Offset(stepsize * j, 0).PasteSpecial
xlPasteValues
Range(PasteRes).Offset(stepsize * j, 0).PasteSpecial
xlPasteFormats
Next j
Next i
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub