Skip to main content
Support is Offline
Today is our off day. We are taking some rest and will come back stronger tomorrow
Official support hours
Monday To Friday
From 09:00 To 17:30
  Wednesday, 31 July 2019
  0 Replies
  2.8K Visits
0
Votes
Undo
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
Next
End With
Application.ScreenUpdating = True

End Sub
There are no replies made for this post yet.