title: Using copied named ranges in formulas in a new workbook
body: <p>I am copying two worksheets from one workbook to a new one using VBA. I am able to copy everything, including the named ranges, over to the new workbook, but the formulas using the ranges do not recognize them unless I manually go into the name manager, double-click on the named range, and select ok.</p>
  
  <p>Is there a way to automate this?</p>
  
  <p>Here is the code for reference:</p>
  
  <pre><code>Dim x As Name
  Dim NewBook As Workbook
  
  Set NewBook = Workbooks.Add
  
  ShSum.Copy before:=NewBook.Sheets(1)
  
  For Each x In ThisWorkbook.Names
    On Error Resume Next
    ' "x.value" refers to the cell references the defined name points to.
    If Left(x.Value, 14) = "='ACFT Scores'" Then
      NewBook.Names.Add Name:=x.Name, RefersTo:=x.Value
    End If
  Next x
  </code></pre>
  
  <p>There are several ranges in other worksheets that I do not need copied over, hence the IF statement.</p>