unanswered I am getting a type mismatch error 13 and i'm not sure why

1 year 1 week ago #1730 by natleon08
All i want to do here, is copy the formulas down in row 2 (columns DB-FN) (row 1 is a header) (sheet is called "sort area")
Then i want the macro to identify the value in each row of column db and if the value of the cell in column db = "IGNORE", cut the entire row and paste the row in a different sheet (called "ignore")

'Copy Formulas down
Dim Lastrow As Long

Worksheets("sort area").Activate

Lastrow = Range("A" & Rows.Count).End(xlUp).Row
Range("DB2:FN" & Lastrow).FillDown

'Remove ignored lines

Dim n As Integer
Dim nLastRow As Long
Dim nFirstRow As Long
Dim r As Range

Set r = ActiveSheet.UsedRange
nLastRow = Lastrow - 1
nFirstRow = 2

Dim I As Long: I = 1

With ActiveSheet
For n = nLastRow To nFirstRow Step -1
If .Cells(n, "DB") = "IGNORE" Then '<
this is the line throwing the error
.Cells(n, "DB").EntireRow.Cut Worksheets("ignore").Cells(I, "A")
.Cells(n, "DB").EntireRow.Delete
I = I + 1
End If
End With
Application.ScreenUpdating = True

End Sub

Please Log in or Create an account to join the conversation.

Moderators: jaychivoExcelfansqiuhongkun