title: Excel VBA loop with loop running a certain number of times based on cell input
body: <p>I am trying to run this macro a set number of times based on a cell value and then copy and paste the results though I need to actively change the paste location offsetting down by 1 row per number of iterations so the first time it pastes results at this cell and the second time one row lower etc...here is the code - any help would be great.  thanks    </p>
  
  <pre><code>Range("AQ2:AU2").Select
  Selection.Copy
  Range("AS255:AW255").Select
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
      :=False, Transpose:=False
  
  Calculate
  </code></pre>
  
  <p>I have updated to this</p>
  
  <pre><code>For x = 1 to ActeiveCells("A1").value
  y=255
  Range("AQ2:AU2").Select
  Selection.Copy
  Range("AS" &amp; y &amp;:":AW" &amp; Y).Select
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
      :=False, Transpose:=False
  y = y +1
  Calculate
  </code></pre>
  
  <p>Every time the macro calculates the cells AQ2:AU2 get different numbers and I want to run 100 loops and get all those results and paste in the cells from AS &amp; Y:AW &amp; Y and then stop after how many time I say in cell A1</p>
  
  <p>Ok lets start from beginning I did not do a good job of explaining this is the original code</p>
  
  <pre><code>Calculate
    Range("AQ2:AU2").Select
      Selection.Copy
      Range("AS255:AW255").Select
      Selection.PasteSpecial Paste:=xlPasteValues
  Calculate
  Range("AQ2:AU2").Select
  Selection.Copy
  Range("AS256:AW256").Select
  Selection.PasteSpecial Paste:=xlPasteValues, 
  </code></pre>
  
  <p>I just kept changing the cells I was pasting to and then recalculating i did this for 100 iterations and it works - though it is sloppy and not efficient  my goal is to loop this 100 or maybe 500 times with the results after calculating to be copied from cell AQ2:AU2 _ these cells never change to the cells AS : AW but the row changes so i keep the previous results</p>