Sub CreateNamedRangesExtWbk()
'Create Named Range in External Workbook
Dim wb As Workbook
Dim filePath As String
Dim currentWbk As String
filePath = "C:\"
Application.ScreenUpdating = False
currentWbk = ActiveWorkbook.Name
For i = 1 To 52
Set wb = Workbooks.Open(filePath & "ACA Week " & i)
Workbooks(currentWbk).Names.Add Name:="Tails" & i, RefersTo:=wb.Worksheets("TailAvailability").Range("$C$6:$R$204")
wb.Close False
Set wb = Nothing
Next
Application.ScreenUpdating = True
MsgBox "Named Ranges have been set!"
End Sub
|