title: Efficiently reformat data layout
body: <p>I have several Excel spreadsheets with data layout like this <a href="https://i.stack.imgur.com/QOju9.jpg" rel="nofollow noreferrer">raw data</a>: </p>
  
  <p><a href="https://i.stack.imgur.com/uxbVq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uxbVq.jpg" alt="enter image description here"></a></p>
  
  <pre><code>company company1    company2    company3
  currency     $        Y          E
  1/1/2013    32.68   12          3
  1/2/2013    12.5    13          4
  1/3/2013    45      45          8  
  </code></pre>
  
  <p>which basically are time series data grouped together. I need the final layout transformed into panel data, like this <a href="https://i.stack.imgur.com/h7O7V.jpg" rel="nofollow noreferrer">wanted panel data</a>:</p>
  
  <p><a href="https://i.stack.imgur.com/BFZrB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BFZrB.jpg" alt="enter image description here"></a></p>
  
  <p>Since my observations are usually very large, it is not practical manually to reformat it.  </p>
  
  <p>Is there a macro code that can achieve such a goal?</p>