title: How do I declare a global variable in VBA?
body: <p>I wrote the following code:</p>
  
  <pre><code>Function find_results_idle()
  
      Public iRaw As Integer
      Public iColumn As Integer
      iRaw = 1
      iColumn = 1
  </code></pre>
  
  <p>And I get the error message:</p>
  
  <blockquote>
    <p>"invalid attribute in Sub or Function"</p>
  </blockquote>
  
  <p>Do you know what I did wrong?</p>
  
  <p>I tried to use <code>Global</code> instead of <code>Public</code>, but got the same problem.</p>
  
  <p>I tried to declare the function itself as `Public, but that also did no good.</p>
  
  <p>What do I need to do to create the global variable?</p>