title: Excel VBA To Set Variable To Worksheet
body: <p>I am trying to set a <code>Worksheet</code> variable to the <code>Activesheet</code> but I am getting an error of</p>
  
  <blockquote>
    <p>Object variable or with block variable not set</p>
  </blockquote>
  
  <p>This is my syntax - what is the appropriate way of doing this?</p>
  
  <pre><code>Sub TestIt()
   Dim ws2 As Worksheet, ws1 As Worksheet
  
    ws2 = ActiveWorkbook.ActiveSheet
    ws1 = "Belgium"
  
    Debug.Print ws2
    Debug.Print ws1
  End Sub
  </code></pre>