I need to determine if the current row (iRow), column A, is duplicated anywhere in the range of A11:A & Range("E7").Value.
E7 will contain a value that will indicate the end of the range. This could realistically be from 11 to maybe 10,000. It will change every time.
The SetGLRRowColor() sub creates the desired back color and is working fine.
So to reiterate, I need to replace my 1=1 with some logic to determine if the value in column A in that row (iRow), is a duplicate anywhere in the range. I can't work with just a true/false result that duplicates exist, I need a true/false result and the line number, one row at a time.
Here is my code:
Macola and SAP Business One Consultant
Check out our Macola tools:
E7 will contain a value that will indicate the end of the range. This could realistically be from 11 to maybe 10,000. It will change every time.
The SetGLRRowColor() sub creates the desired back color and is working fine.
So to reiterate, I need to replace my 1=1 with some logic to determine if the value in column A in that row (iRow), is a duplicate anywhere in the range. I can't work with just a true/false result that duplicates exist, I need a true/false result and the line number, one row at a time.
Here is my code:
Code:
'check for duplicate customer numbers
For iRow = 11 To Range("E7").Value
If iRow = 11 Then
'do nothing, duplicates not possible on first row
Else
If [highlight #FCE94F]1 = 1 Then 'need code here[/highlight]
Call SetGLRRowColor("YES", "Duplicate Account", iRow)
Else
Call SetGLRRowColor("NO", "", iRow)
End If
End If
Next iRow
Macola and SAP Business One Consultant
Check out our Macola tools: