I have tried a number of different variations to copy and paste but they are not working.
I keep experiencing a run time error.
I keep experiencing a run time error.
Rich (BB code):
Sub Filter()
Dim Wkb As Excel.Workbook
Dim ws As Sheets
Dim i As Long
Dim LastRow As Long
Dim LastRow1 As Long
Dim Rng As Range
Dim deleteRange As Range
Set Wkb = ThisWorkbook
Set ws = ThisWorkbook.Worksheets
ws_count = Wkb.Worksheets.Count
Sheets("MYA Dump").Activate
LastRow = Wkb.Worksheets("MYA Dump").Cells(Rows.Count, 1).End(xlUp).Row
LastRow1 = Wkb.Worksheets("MYA Dump").Cells(Rows.Count, 1).End(xlUp).Row
ActiveSheet.Range("$A$5:$gh$" & LastRow1).AutoFilter Field:=12, Criteria1:="CGMFL"
ActiveSheet.Range("$A$5:$gh$" & LastRow1).AutoFilter Field:=18, Operator:= _
xlFilterValues, Criteria2:=Array(0, "12/31/2018")
Sheets("MYA Dump").Activate
Sheets("MYA Dump").Range("A:gh").SpecialCells(xlCellTypeVisible).Copy
Sheets("2018 Raw Data").Activate
Sheets("2018 Raw Data").Range("e:gl").ClearContents
Sheets("2018 Raw Data").Range("e:gl").Selection
Sheets("2018 Raw Data").Range("e:gl").SpecialCells(xlCellTypeVisible).Paste
'A:DPasteDown
End Sub