ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Why does this code not get updated (https://www.excelbanter.com/excel-programming/381732-why-does-code-not-get-updated.html)

Fortune

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



All times are GMT +1. The time now is 07:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com