

如果能用VBA,按如下操作:
1、打开工作表
2、按ALT+F11,会打开VBA窗口,插入/模块,将代码复制到模块中
3、把VBA窗口弄小一点,以便能看到工作表
4、选择要处理的数据区域,如图上的黄色区域
5、将光标放在代码中任意一行
6、运行/运行子过程
结果在自动插入的新的工作表上
代码如下:
Sub 横向取唯一()
Selection.Copy '首先要选择要处理的数据区域
Sheets.Add.Paste '自动插入新工作表,并在新工作表上得到结果
Dim L%, y%, x%, n%
L = Selection.Columns.Count
For y = 1 To Selection.Rows.Count
n = 0
For x = 1 To L
If Application.CountIf(Cells(y, L + 1).Resize(1, 120), Cells(y, x)) = 0 Then
n = n + 1
Cells(y, L + n) = Cells(y, x) '假定黄色区域宽度小于等于120列
End If
Next
Next
End Sub