title: Run Macro in specific Workbook only
body: <p>I have two workbooks that for data exchange. Workbook A pulls info from Workbook B.</p>
  
  <p>I have macros running in A that to be performed in A.</p>
  
  <p>When I open A before B, the macros are being performed in B. If I open B before A then the macros work in A as expected.</p>
  
  <pre><code>Private Sub Workbook_Open()
  'If ThisWorkbook.Name = "A" Then
      ThisWorkbook.Sheets("Background").Select
      Call Background_Lists
      Call Find_Missing
  'End If
  End Sub
  </code></pre>
  
  <p>I attempted to use sheet/workbook activation as well as toying with an If statement (commented out).</p>
  
  <p><strong>Edit: Here is code to Background_Lists</strong></p>
  
  <pre><code>Sub Background_Lists()
  a = 0
  Range("E4:E2004").Clear
  Range("B4:B2004").Value = Range("=Parts!B18:B2018").Value
  Range("D4:D2004").Value = Range("=[B.xlsx]Sheet1!A2:A2002").Value
  For i = 4 To 2004
      If Cells(i, 4).Value &gt;= 300000 Then
          Cells(4 + a, 5).Value = Cells(i, 4).Value
          a = a + 1
      End If
  Next i
  End Sub
  </code></pre>