Noob here. I am trying to do a ton in one line and it is shutting down excel every time I try to run it. What I need to do is see if "cell" is in the range on "Scan data". If it is I wanna add 1 to its count.
When I write it like this I get a mismatch error.
For Each cell In Range("K3:K500")
i = cell.Value
For Each cell_n In Workbooks("North Dock Scan Data").Sheets("Scan Data").Range("E3:E500")
If Range("E" & cell.Row).Value = cell_n.Value Then
i = (Range("K" & cell_n.Row))
i = i + 1
cell.Value = i
End If
Next
Next
When I write it like this it shuts down. I need the similar commands but can't debug it any further.
For Each cell In Range("K3:K500")
i = cell.Value
For Each cell_n In Workbooks("North Dock Scan Data").Sheets("Scan Data").Range("E3:E500")
If str(Range("E" & cell.Row).Value) = str(cell_n.Value) Then
i = (Range("K" & cell_n.Row))
i = i + 1
cell.Value = i
End If
Next
Next
I appreciate any help in advance.