I get an error on this line in my code, any ideas what the issue may be?
Intersect(.UsedRange, .UsedRange.Offset(1)).SpecialCells(12).EntireRow.Delete Here is the rest of the code:
Sub DefineDL_IDL() Dim wbTHMacro As Workbook, wsRegulares As Worksheet, wsRegularesDemitidos As Worksheet, wsTempActivos As Worksheet, _ wsTempJA As Worksheet, wsTempFit As Worksheet, wsTempDemitidos As Worksheet, wsPS As Worksheet, wsResultados As Worksheet, _ wsDLList As Worksheet, wssheet As Worksheet, count_DL As Integer, count_IDL As Integer Dim x&, r As Long '*************REGULARES*********** Sheets("Regulares").Select 'Debug.Print xlToRight 'Sheets("Raw").Copy before:=Sheets(2) With Sheets("Regulares") '.Name = "Final2" .UsedRange.AutoFilter 9, "INATIVE" Intersect(.UsedRange, .UsedRange.Offset(1)).SpecialCells(12).EntireRow.Delete r = WorksheetFunction.CountA(.Range("A:A")) .UsedRange.AutoFilter .Range("J:J").Insert xlToRight .Range("J1").Value = "Real MO" .Range("K:K").Cut .Range("I:I").Insert xlToRight .Range("Q:Q").Cut .Range("I:I").Insert xlToRight .Range("L2:L" & r).FormulaR1C1 = "=VLOOKUP(RC[-3],'DL List'!C[-11]:C[-10],2,0)" .Range("L2:L" & r).Value = .Range("L2:L" & r).Value For x = 2 To r If Range("L" & x).Text = "#N/A" Then 'If Range("K" & x).Value = "DL" Then ' Range("L" & x).Value = "DL" 'Else: Range("L" & x).Value = "IDL": End If Range("L" & x).Value = "IDL" End If Next x End With count_DL = Application.WorksheetFunction.CountIf(ActiveSheet.Range("L:L"), "DL") count_IDL = Application.WorksheetFunction.CountIf(ActiveSheet.Range("L:L"), "IDL") Worksheets("Resultados").Range("B17") = count_DL Worksheets("Resultados").Range("C17") = count_IDL