Hello btcoutermash,
I assume that you are the same Poster (LeedMe).
Following is the code adjusted to suit your workbook:-
Sub TransferData()
Dim ar As Variant
Dim i As Integer
Dim lr As Long
ar = Array("MACH", "FAB")
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For i = 0 To UBound(ar)
Sheet3.Range("G7", Sheet3.Range("G" & Sheet3.Rows.Count).End(xlUp)).AutoFilter 1, ar(i), 7, , 0
lr = Sheet3.Range("G" & Rows.Count).End(xlUp).Row
If lr > 1 Then
Sheet3.Range("G8", Sheet3.Range("G" & Sheet3.Rows.Count).End(xlUp)).EntireRow.Copy Sheets(ar(i)).Range("A" & Rows.Count).End(3)(2)
Sheets(ar(i)).Columns.AutoFit
End If
Next i
Sheet3.[G7].AutoFilter
Application.DisplayAlerts = True
Application.CutCopyMode = False
Application.ScreenUpdating = True
MsgBox "Data transfer completed!", vbExclamation, "Status"
End Sub
One of the reasons that you may have received an error is because you placed a full stop after "MACH" in the array. The code would not have recognised this as a criteria as the input sheet has "MACH" not "MACH." For the same reason, the code would not have recognised a sheet named "MACH." In your case, sheet names and criteria must be spelt exactly the same.
Another reason would be that the sheet code for your Sheet1(your input sheet) is actually Sheet3. You'll notice that in the adjusted code above I have altered this for you.
Another reason would be that your data begins in row 8 with headings in row 7. The sample I supplied has the data begining in row 2 with headings in row 1. I have adjusted this also for you.
I have also removed the delete line of code.
Test the adjusted code in a copy of your work book first.
I hope that this helps.
cheerio,
vcoolio.