Hi
This my Code Not Working When noHave " #N/A
Sub Add_Subtotals()
LastRow = Range("O" & Rows.Count).End(xlUp).Row - 1
Range("A1:W" & LastRow).AutoFilter Field:=23, Criteria1:="#N/A"
If Range("A1:A" & LastRow).SpecialCells(xlCellTypeVisible).Count > 1 Then
ActiveSheet.Range("A2:W" & LastRow).SpecialCells(xlCellTypeVisible).Copy
LastRowSum = Worksheets("ReportAll").Range("A" & Rows.Count).End(xlUp).Row
Application.CutCopyMode = False
ElseIf Range("A1:A" & LastRow).SpecialCells(xlCellTypeVisible).Count < 1 Then
Sheets("ReportAll").Range("A" & LastRowSum - 26).PasteSpecial xlPasteValues
End If
'Remove AutoFilter
ActiveSheet.AutoFilterMode = False
End Sub
This my Code Not Working When noHave " #N/A
Sub Add_Subtotals()
LastRow = Range("O" & Rows.Count).End(xlUp).Row - 1
Range("A1:W" & LastRow).AutoFilter Field:=23, Criteria1:="#N/A"
If Range("A1:A" & LastRow).SpecialCells(xlCellTypeVisible).Count > 1 Then
ActiveSheet.Range("A2:W" & LastRow).SpecialCells(xlCellTypeVisible).Copy
LastRowSum = Worksheets("ReportAll").Range("A" & Rows.Count).End(xlUp).Row
Application.CutCopyMode = False
ElseIf Range("A1:A" & LastRow).SpecialCells(xlCellTypeVisible).Count < 1 Then
Sheets("ReportAll").Range("A" & LastRowSum - 26).PasteSpecial xlPasteValues
End If
'Remove AutoFilter
ActiveSheet.AutoFilterMode = False
End Sub