I think I follow what you would like to do so the following VBA code, placed in a standard module, should do the trick for you:-
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In Worksheets
If ws.Name <> "Main" Then
With ws.Range("G5", ws.Range("G" & ws.Rows.Count).End(xlUp))
.AutoFilter 1, 365, xlOr, 366
On Error Resume Next
Sheet3.Range("A" & Rows.Count).End(3)(2).PasteSpecial xlPasteValues
ws.AutoFilterMode = False
Application.CutCopyMode = False
Application.ScreenUpdating = True
Following is the link to my test work book (based on the sample that you supplied):-
You'll see in the sample that I have created a "Main" sheet (sheet3) where all the required data will be consolidated.
The code filters Column G in all sheets (except the "Main" sheet) for the values 365 or 366 and transfer the relevant rows of data to the "Main" sheet. The "Main" sheet is refreshed each time that the code is executed so that you will not have duplication.
Click on the "RUN" button to see it work.
In all the source sheets, you will need to format Column G to "General" as at present there is a variety of formats which could interfere with the proper execution of the code.
I hope that this helps.