Hello, below is the code I am using and I keep getting "Subscript out of range" error at the highlighted line.
I have no idea why I am getting it.
Any advices or tips would help alot,
Thank you very much!
PS: LR is always bigger than 2 and the code has been pasted into Worksheet module.
I have no idea why I am getting it.
Any advices or tips would help alot,
Thank you very much!
PS: LR is always bigger than 2 and the code has been pasted into Worksheet module.
Rich (BB code):
Option Base 0
Sub a()
Dim LR As Long, i As Long, skipArr() As Long, j As Long, count As Long
Dim check As Boolean
count = 0
LR = Range("A" & Rows.count).End(xlUp).Row
ReDim skipArray(0 To LR - 2) As Long
For i = 2 To LR
check = True
For j = 1 To count
If skipArray(j) = i Then
check = False
End If
Next j
If check Then
For j = i + 1 To LR
If Range("B" & i).Value = Range("C" & j).Value And Range("C" & i).Value = Range("B" & j).Value Then
Range("A" & j).ClearContents
skipArr(count) = j
count = count + 1
End If
Next j
End If
Next i
End Sub