我有一个 Excel 文件,其中 B1 到 B500 列(可能会有所不同)填充了数字。例如:

我需要输出如下:

到目前为止,我有这么多代码:
Sub Max()
Dim i As Long, j As Long
Dim cl As Excel.Range
i = 1
j = 1
For i = sheet.UsedRange.Rows.Count To 1 Step -1
cl = sheet.Cells(i, 2) '## Examine the cell in Column B
If xl.WorksheetFunction.CountIf(sheet.Range("B:B"), cl.Value) > 1 Then
cl.Value = sheet.Cells(j, 3).value 'copy to Column C
End If
j = j + 1
Next i
End Sub
此代码的作用是在 B 列中查找重复项并从该列中删除其他条目。C 列中没有写入任何内容。我希望 B 列最后不进行编辑。也无法弄清楚如何在这里实现排序。
请帮忙。