I have have finally got my code up and running for the most part. I am comparing the values of cells, which contain strings. My function works to a degree but it is case dependant. How do you implement a non-case sensetive comparison of two strings in vb?
VB Code:
  1. Sub RemoveDuplicates()
  2.     Dim iListCount As Integer
  3.     Dim iCtr As Integer
  4.  
  5.     iListCount = xlSheet.usedrange.Rows.Count
  6.     xlSheet.Range("A1").Activate
  7.     Do Until xlApp.activecell = ""
  8.        For iCtr = 1 To iListCount
  9.           If xlApp.activecell.Row <> xlSheet.cells(iCtr, 1).Row Then
  10.              If xlApp.activecell.Value = xlSheet.cells(iCtr, 1).Value Then
  11.                 ' a duplicate name was found
  12.                 If xlApp.activecell.offset(0, 1).Value = xlSheet.cells(iCtr, 2).Value Then
  13.                     If xlApp.activecell.offset(0, 2).Value = xlSheet.cells(iCtr, 3).Value Then
  14.                         ' a duplicate student was found
  15.                         xlSheet.cells(iCtr, 1).Delete shift:=-4162
  16.                         iCtr = iCtr + 1
  17.                     End If
  18.                 End If
  19.              End If
  20.           End If
  21.        Next iCtr
  22.        xlApp.activecell.offset(1, 0).Select
  23.     Loop
  24. End Sub
In the above code I am refering to the cells by value rather than by text, this is because I'm not sure how to deal with Unicode in vb. In C its a nightmare sometimes trying to distinguish between the various encodings.