Anyone know why I'm getting a Run-time error '1004': Application-defined or object-defined error on this statement?
Sub FilterQueues()
Dim wscopy As Worksheet
Dim wsdest As Worksheet
Dim lCopyLastRow As Long
Dim lDestLastRow As Long
Set wscopy = Workbooks("Star Ninja Tool 9.1_2.xlsm").Worksheets("Staging")
Set wsdest = Workbooks("Star Ninja Tool 9.1_2.xlsm").Worksheets("Staffing_Open_Report")
lCopyLastRow = wscopy.Cells(wscopy.Rows.Count, "B").End(xlUp).Offset(1).Row
lDestLastRow = wsdest.Cells(wsdest.Rows.Count, "B").End(xlUp).Offset(1).Row
wsdest.Range("A3:AF" & lDestLastRow).ClearContents
With wscopy
.Range("$A:$AF").AutoFilter field:=32, Criteria1:="N"
.Range("$A1:$AE" & lCopyLastRow).SpecialCells(xlCellTypeVisible).EntireRow.Copy _
Destination:=wsdest.Range("B2")
End With
End Sub
Sub FilterQueues()
Dim wscopy As Worksheet
Dim wsdest As Worksheet
Dim lCopyLastRow As Long
Dim lDestLastRow As Long
Set wscopy = Workbooks("Star Ninja Tool 9.1_2.xlsm").Worksheets("Staging")
Set wsdest = Workbooks("Star Ninja Tool 9.1_2.xlsm").Worksheets("Staffing_Open_Report")
lCopyLastRow = wscopy.Cells(wscopy.Rows.Count, "B").End(xlUp).Offset(1).Row
lDestLastRow = wsdest.Cells(wsdest.Rows.Count, "B").End(xlUp).Offset(1).Row
wsdest.Range("A3:AF" & lDestLastRow).ClearContents
With wscopy
.Range("$A:$AF").AutoFilter field:=32, Criteria1:="N"
.Range("$A1:$AE" & lCopyLastRow).SpecialCells(xlCellTypeVisible).EntireRow.Copy _
Destination:=wsdest.Range("B2")
End With
End Sub