title: Using VBA to add cells from different spreadsheets when the sheets haven't been created yet
body: <p>I am new to VBA. I am trying to take cell 207 from 12 different sheets and add them so that the sum is placed in another cell on a 13th sheet. I would like to create a for loop of some sort to increment cell indices. This might sound straightforward, but not all of the 12 sheets have been created yet. For example, there are currently five sheets, and I want to click a button on sheet thirteen that adds the sum of cell 207 from all sheets that are present. When an additional sheet is added, this button will automatically update the sum.</p>
  <p>This is my code:</p>
  <pre><code>
  Sub newMethod()
  
  ' declare the double variable
  Dim AddEntry
  
  
  ' populate the double variable
   AddEntry = Worksheets(&quot;0122&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;0222&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;0322&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;0422&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;0522&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;0622&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;0722&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;0822&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;0922&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;1022&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;1122&quot;).Range(&quot;K207&quot;).Value + Worksheets(&quot;1222&quot;).Range(&quot;K207&quot;).Value
  
  
  ' Set B5 equal to variable
  Range(&quot;B5&quot;).Value = AddEntry
  
  End Sub
      
  </code></pre>
  <p>There is a syntax error for sure, but I know that the methodology behind the code is completely incorrect. I am not sure how to fix it, or if I am taking a completely incorrect approach.</p>
  <p>Just with formulas I accomplished this, but I would have to type out each sheet and I would like to just create some sort of for loop in VBA that increments the cell index.</p>
  <p><code>= IF(ISNUMBER('0522'!K207),'0522'!K207,0))</code></p>