Try:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("G4")) Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Dim LastRow As Long, rng As Range, cRng As Range, srcWS As Worksheet, desWS As Worksheet, arr As Variant, fnd1 As Range, fnd2 As Range
Dim let1 As String, let2 As String, lRow As Long, x As Long, cnt As Long, mon As String
Set srcWS = Sheets("Inputs")
Set desWS = Sheets("Output")
desWS.UsedRange.Offset(1).ClearContents
x = Mid(Target, 2, 1)
If x = 1 Then mon = "Jan"
If x = 2 Then mon = "Apr"
If x = 3 Then mon = "Jul"
If x = 4 Then mon = "Oct"
Select Case Target.Value
Case "Q" & x
With srcWS
LastRow = .Range("C" & Rows.Count).End(xlUp).Row
arr = Application.Transpose(.Range("E4", .Range("E" & .Rows.Count).End(xlUp)).Value)
For Each rng In srcWS.Range("C4:C" & LastRow)
With Sheets(rng.Value)
lRow = .Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set fnd1 = .Range("H1").Resize(, 12).Find(mon)
let1 = Replace(Cells(1, fnd1.Column).Address(False, False), "1", "")
Set fnd2 = .Range("V1").Resize(, 12).Find(mon)
let2 = Replace(Cells(1, fnd2.Column).Address(False, False), "1", "")
.Cells(1, 1).CurrentRegion.AutoFilter 2, arr, xlFilterValues
cnt = .[subtotal(103,A:A)] - 1
Set cRng = Intersect(.AutoFilter.Range.Offset(1), .Range("A:B,D:E"))
cRng.Copy desWS.Cells(desWS.Rows.Count, "A").End(xlUp).Offset(1)
.Range(let1 & "2:" & let1 & lRow).Resize(, 3).SpecialCells(xlCellTypeVisible).Copy desWS.Cells(desWS.Rows.Count, "F").End(xlUp).Offset(1)
.Range(let2 & "2:" & let1 & lRow).Resize(, 3).SpecialCells(xlCellTypeVisible).Copy desWS.Cells(desWS.Rows.Count, "J").End(xlUp).Offset(1)
desWS.Cells(desWS.Rows.Count, "E").End(xlUp).Offset(1).Resize(cnt) = Sheets(rng.Value).Name
.Range("A1").AutoFilter
End With
Next rng
End With
End Select
Application.ScreenUpdating = True
End Sub
Bookmarks