Question : drop db but keep the files

is it possible with the DROP command to tell to remove the database from SQL Server, but keep the file where they are..

thanks

Answer : drop db but keep the files

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