title: Macro to repeat copy paste to the left based on the value of a particular cell
body: <p>I am completely new to VBA. I have a spreadsheet that needs to align data to dates. The dates change dynamically as the sheet is updated. </p>
  
  <p>Basically the macro below moves the data over one column to the left (replaces column J with data from column K to Q) and clears the existing data from Q. the data is a combination of just values, formulas and formatting. The below macro works however I need it to repeat itself the number of times whatever the value is in cell E3 (this cell will take into account time lag to realign the data). </p>
  
  <p>So basically can someone please help this repeat this macro based on the value in E3 if it is greater then 1.  Also I get a bug clearing the cells after it is repeated once because the cells are already clear so maybe run the first part as is then adding an <code>IF ("E3") &gt; 1</code> then moving <code>Range("K6:P500")</code> the number of times in E3. I have tried to do this but I don't know how to get the repeat and the IF I put together didn't really work. </p>
  
  <p>Thanks again so much for any help of suggestions! </p>
  
  <pre><code>' Week_update Macro
  '
  ' Keyboard Shortcut: Ctrl+Shift+W
  '
      Range("K6:Q500").Select
      Selection.Copy
      Range("J6").Select
      ActiveSheet.PasteSpecial Format:=2, Link:=1, DisplayAsIcon:=False, _
          IconFileName:=False
      Range("Q6").Select
      Range("Q6:Q500").Select
      Selection.SpecialCells(xlCellTypeConstants, 1).Select
  Selection.ClearContents
  End Sub
  </code></pre>