L
L. Howard
If a value in varData occurs more than once, then delete all same values in varData and list remaining values in column F.
Values as either Integers or text or both, if possible.
This code does not like the CountIf.
Thanks.
Howard
Sub LoneValueStay()
Dim varData As Variant
Dim i As Long
varData = Sheets("Sheet1").Range("A215") '// Read in the data.
For i = LBound(varData) To UBound(varData)
If Application.WorksheetFunction.CountIf(varData(i, varData)) > 1 Then
varData(i) = ""
'varData(i).Delete
End If
Next i
'// Write result to sheet.
'Sheets("Sheet1").Range("F1").Resize(UBound(varData) - LBound(varData) + 1, 1) _
= varData
End Sub
Values as either Integers or text or both, if possible.
This code does not like the CountIf.
Thanks.
Howard
Sub LoneValueStay()
Dim varData As Variant
Dim i As Long
varData = Sheets("Sheet1").Range("A215") '// Read in the data.
For i = LBound(varData) To UBound(varData)
If Application.WorksheetFunction.CountIf(varData(i, varData)) > 1 Then
varData(i) = ""
'varData(i).Delete
End If
Next i
'// Write result to sheet.
'Sheets("Sheet1").Range("F1").Resize(UBound(varData) - LBound(varData) + 1, 1) _
= varData
End Sub