我给你做个VBA,简单的很
注意,先做好备份
在工作表名称上 右键,查看代码,将下面的代码复制入其中,按代码里面的说明,改变两个变量的值,按F5运行一次,返回sheet表就好了
------------
Sub 分行()
Dim r&: r = 20 '每列的行数
Dim c As Range: Set c = Range("A1:A4000") '原数据区域
'使用前改变上面2个变量
Dim i&, n%
If c.Columns.Count > 1 Then MsgBox "第二个参数有误!"
If c.Rows.Count Mod r Then n = Int(c.Rows.Count / r) + 1 Else n = Int(c.Rows.Count / r)
If n > 255 Then
If MsgBox("列数将超过工作表限制!仍要进行?", vbOKCancel) = vbCancel Then Exit Sub
End If
For i = 2 To n
c.Cells((i - 1) * r + 1, 1).Resize(r, 1).Copy Cells(1, i).Resize(r, 1)
Next
MsgBox "ok!"
End Sub