Hi there,
Try using the following version of your code:
Option Explicit
Sub Regression()
Dim wks As Worksheet
Application.ScreenUpdating = False
For Each wks In ActiveWorkbook.Worksheets
If wks.Name = "0. Hedge Index" Or _
wks.Name = "1. Effectiveness Assessment" Or _
wks.Name = "IRS All Valuation Data" Or _
wks.Name = "Swap Key" Or _
wks.Name = "Immaterial FV at 2.1 -Bloomberg" Or _
wks.Name = "Tickmarks" Then
wks.Activate ' <<< This statement might not be required
' Regression Macro
' Keyboard Shortcut: Ctrl+r
Application.Run "ATPVBAEN.XLAM!Regress", _
wks.Range("$L$14:$L$43"), _
wks.Range("$P$14:$P$43"), True, False, , _
wks.Range("$F$47"), False, False, False, False, , False
End If
Next wks
Application.ScreenUpdating = True
End Sub
Hope this helps - please let me know how you get on.
Regards,
Greg M
Bookmarks