try this:
Sub test()
Dim ws As Worksheet, fiveAM As Worksheet, eightAM As Worksheet, ninePM As Worksheet
Dim wb As Workbook
Dim lrow As Long, i As Integer
Dim shname As String
Dim columntocopy As Range, rowtocopy As Range, rngtocopy As Range
Set wb = ThisWorkbook
Set ws = wb.Sheets("MAIN")
Set fiveAM = wb.Sheets("5AM")
Set eightAM = wb.Sheets("8AM")
Set ninePM = wb.Sheets("9PM")
Set columntocopy = ws.Range("A:A,E:E,F:F")
With ws
lrow = .Range("A" & .Rows.Count).End(xlUp).Row
For i = 0 To 2
.AutoFilterMode = False
shname = .Range("B1").Offset(0, i).Value
.Range("B1:B" & lrow).Offset(0, i).AutoFilter Field:=1, Criteria1:="X"
Set rowtocopy = .Range("A1:A" & lrow).Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow
Set rngtocopy = Intersect(rowtocopy, columntocopy)
rngtocopy.Copy
Select Case shname
Case "5AM": fiveAM.Range("A" & fiveAM.Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Case "8AM": eightAM.Range("A" & eightAM.Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Case "9PM": ninePM.Range("A" & ninePM.Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
End Select
Next
.AutoFilterMode = False
End With
Application.CutCopyMode = False
End Sub
I assumed your data in each sheet starts at Column A
.
Tried and tested.
I leave the further testing to you.