同时按Alt+F11这二个键,进入VBA编辑界面,点击编辑画面的菜单:“插入”--“模块”,然后在里面完整复制下面的代码: Sub 提取重复到B列() x = Sheet1.[A65536].End(xlUp).Row m = 0 For i = 1 To x If Application.CountIf(Sheet1.Range("A1:A" & x), Sheet1.Cells(i, 1)) > 1 Then m = m + 1 Sheet1.Cells(m, 2) = Sheet1.Cells(i, 1)