title: loop through specified sheets in VBA
body: <p>I am trying to use a bit of code I found here <a href="https://stackoverflow.com/questions/21761697/for-each-function-to-loop-through-specifically-named-worksheets">For Each Function, to loop through specifically named worksheets</a> to loop through specified sheets in a workbook, run a small amount of code and move to next sheet.</p>
  
  <pre><code>Sub LoopThroughSheets()
  Dim Assets As Worksheet
  Dim Asset As Worksheet
  
  
  Assets = Array("pipe_mat_tables", "pipe_diam_tables", "pipe_length_tables")
  For Each Asset In Assets
  'my code here
     MsgBox ActiveSheet.Name 'test loop
  
  Next Asset
  
  End Sub
  </code></pre>
  
  <p>This is not looping through the sheets. I tried <code>Dim Assets as Worksheet</code> but this broke the code. </p>
  
  <p>Any help much appreciated,</p>
  
  <p>Cheers</p>