title: Tab Specific VBA Loop
body: <p>new to VBA. I’m trying to create a VBA loop code to run through a series of tabs and perform my code on each tab and basically export data into a central tab in my worksheet called “database”. </p>
  
  <p>My file is setup so users can add additional “tasks” and thus I will have multiple tabs named:
  Task, Task (2), Task (3), Task (4), Task (5) . . etc</p>
  
  <p>My VBA terminology is poor, however in excel basic terms I am trying to</p>
  
  <p>-IF tab name (Starts with “TASK”)</p>
  
  <p>-THEN (Perform my code in that particular TASK tab)</p>
  
  <p>-AND (paste user input data from that tab into my “database” tab into a NEW ROW Starting A2)</p>
  
  <p>Hopefully this makes sense (Task tab gets pasted in cell A2 of “database” tab) (Task (2) gets pasted into cell A3 of “database” tab)
  (the Sheet reference will need to change as “task” will change to task (2) + Task (3) etc.</p>
  
  <pre><code>'My Code
   Sheets("Task").Select
  Range("A2").Select
  Range(Selection, Selection.End(xlDown)).Select
  Selection.Copy
  Sheets("Database").Select
  Range("A2").Select
  **'This will need to change each time I paste a new tab in (A2 &gt; A3 &gt; A4)**
      Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
          :=False, Transpose:=True
  Sheets("External (Client) Output").Select
  </code></pre>