title: Average rows of variable length VBA
body: <p>I am trying to get a simple VBA code as part of a Macro that will put in column B the average of the values for each row.
  I have code that generates a time series and fills a column per simulation such that each column is a time series starting at column C. 
  The number of simulations vary so I simply need something that averages the value for each point in time (ie for each row across all simulations) whilst adjusting for the number of simulations that are run (columns that are filled). I would then like it to generate a single graph of all the time series highlighting the average values that are calculated.
  Many thanks if you can help!</p>
  
  <p>Here, for example, is the code that takes the values for the time steps from sheet1 and places it in columnA sheet2. I would like the macro to now place the average in the appropriate row down Column B:
  <img src="https://i.stack.imgur.com/7qcHY.png" alt="Screenshot Of current output"></p>
  
  <pre><code>Sheets("Sheet1").Select
  Range("E5").Select
  Range(Selection, Selection.End(xlDown)).Select
  Selection.Copy
  Sheets("Sheet2").Select
  Cells(1, 1).Select
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
      :=False, Transpose:=False
  </code></pre>