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”.
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
My VBA terminology is poor, however in excel basic terms I am trying to
-IF tab name (Starts with “TASK”)
-THEN (Perform my code in that particular TASK tab)
-AND (paste user input data from that tab into my “database” tab into a NEW ROW Starting A2)
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.
'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 > A3 > A4)**
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Sheets("External (Client) Output").Select