Hey, so I'm stuck in the office over the bank holiday and my VBA wont run. I've copied it from another model and changed the names of the cells so maybe that had something to do with it (basically I added "GBP_" as a prefix). the code is below. It seems to get up to selecting and copying GBP_MacroTempcalculation but then it stops :
Sub GBP_CalculateZeroline()
Application.ScreenUpdating = False
CalStartTime = Timer
Dim MaxCount As Double
Dim MinCount As Double
Dim ErrorCounter As Double
MinCount = Range("GBP_MinCount").Value
MaxCount = Range("GBP_MaxCount").Value
Range("GBP_MacroCumCalculation").ClearContents
ErrorCounter = 0
For counter = MinCount To MaxCount
Range("GBP_ActiveCounter").Value = counter
Calculate
Range("GBP_MacroTempcalculation").Select
Selection.Copy
Range("GBP_MacroCumStart").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
If Range("c28").Value = False Then
Range("GBP_ErrorStart").Offset(ErrorCounter, 0).Value = counter
ErrorCounter = ErrorCounter + 1
End If
Application.StatusBar = "Calculating " & counter & " of " & MaxCount
Next counter
CalculationTime = Timer - CalStartTime
Application.ScreenUpdating = True
Application.StatusBar = False
MsgBox "Time taken: " & Round(CalculationTime / 60, 2) & " minutes"
End Sub
Bookmarks