For the first macro to work with autofilters, you'll need to fix the data on the on sheet that has fully blank rows all through the data. Make sure column A is filled properly all the way down all the data sets on all sheets so the Autofilter can "see" them all as a single set of data. The rows with REF errors will end up at the bottom.
Then this macro will do your consolidation:
Sub ConsolidateData()
Dim ws As Worksheet, wsMaster As Worksheet, LR As Long
Set wsMaster = Sheets("Master Sheet - Do Not Touch")
wsMaster.UsedRange.Offset(3).EntireRow.Clear
For Each ws In Worksheets
If ws.Name <> wsMaster.Name And ws.Name <> "Export" Then
With ws
.AutoFilterMode = False
.Rows(3).AutoFilter 10, "<>", xlAnd, "<>0"
LR = .Range("J" & .Rows.Count).End(xlUp).Row
If LR > 3 Then .Range("A4:A" & LR).EntireRow.Copy wsMaster.Range("A" & Rows.Count).End(xlUp).Offset(1)
.Rows(3).AutoFilter
End With
End If
Next ws
With wsMaster
LR = .Range("A" & .Rows.Count).End(xlUp).Row
.Range("A4:DA" & LR).Sort Key1:=.Range("B4"), Order1:=xlAscending
End With
End Sub
Bookmarks