Question : #tables always in tempdb only?

When we create temp tables in user tables, are they still created in tempdb only?

Answer : #tables always in tempdb only?

OK, to set the named range to an external workbook, try this code:

Be sure to change the filepath to where your "ACA Week x" workbooks are located in this line:

filePath = "C:\"
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
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
Random Solutions  
 
programming4us programming4us