在Excel中如何使竖排的数据变为横排? 比如: A B C A B C D A B A B C 变成: A B C A B C D A B A B C 10
是:ABCABCDABABC变为:ABCABCDABABC用宏或函数的方法,因为比较多,谢谢...
是:
A
B
C
A
B
C
D
A
B
A
B
C
变为:
A B C
A B C D
A B
A B C
用宏或函数的方法,因为比较多,谢谢 展开
A
B
C
A
B
C
D
A
B
A
B
C
变为:
A B C
A B C D
A B
A B C
用宏或函数的方法,因为比较多,谢谢 展开
4个回答
展开全部
用宏
Sub xxzl() '整理上面下载的数据面表
Dim i&, Myr&, r%, Arr, Arr1(), Arr2, Myc%
Dim d, k, ks, js, j&, col%, r1, ii&
Set d = CreateObject("Scripting.Dictionary")
Sheet1.Select
Myr = Sheet1.[a65536].End(xlUp).Row
Arr = Sheet1.Range("a1").CurrentRegion
For i = 1 To UBound(Arr)
If Arr(i, 1) = "A" Then
r = r + 1
ReDim Preserve Arr1(1 To r)
Arr1(r) = i
End If
d(Arr(i, 1)) = ""
Next
k = d.keys
Range("B:Z").ClearContents
[B1].Resize(1, 4) = k
ReDim Arr2(1 To r, 1 To UBound(k) + 2)
For j = 1 To r
Arr2(j, 1) = j
If j <> r Then
js = Arr1(j + 1) - 1
Else
js = Myr
End If
ks = Arr1(j)
For ii = ks To js
Set r1 = Rows(1).Find(Arr(ii, 1))
If Not r1 Is Nothing Then
col = r1.Column
Arr2(j, col) = Arr(ii, 1)
Else
Myc = [iv1].End(xlToLeft).Column + 1
Cells(1, Myc) = Arr(ii, 1)
Arr2(j, Myc) = Arr(ii, 1)
End If
Next
Next
[B1].Resize(r, UBound(Arr2, 2)) = Arr2
End Sub
Sub xxzl() '整理上面下载的数据面表
Dim i&, Myr&, r%, Arr, Arr1(), Arr2, Myc%
Dim d, k, ks, js, j&, col%, r1, ii&
Set d = CreateObject("Scripting.Dictionary")
Sheet1.Select
Myr = Sheet1.[a65536].End(xlUp).Row
Arr = Sheet1.Range("a1").CurrentRegion
For i = 1 To UBound(Arr)
If Arr(i, 1) = "A" Then
r = r + 1
ReDim Preserve Arr1(1 To r)
Arr1(r) = i
End If
d(Arr(i, 1)) = ""
Next
k = d.keys
Range("B:Z").ClearContents
[B1].Resize(1, 4) = k
ReDim Arr2(1 To r, 1 To UBound(k) + 2)
For j = 1 To r
Arr2(j, 1) = j
If j <> r Then
js = Arr1(j + 1) - 1
Else
js = Myr
End If
ks = Arr1(j)
For ii = ks To js
Set r1 = Rows(1).Find(Arr(ii, 1))
If Not r1 Is Nothing Then
col = r1.Column
Arr2(j, col) = Arr(ii, 1)
Else
Myc = [iv1].End(xlToLeft).Column + 1
Cells(1, Myc) = Arr(ii, 1)
Arr2(j, Myc) = Arr(ii, 1)
End If
Next
Next
[B1].Resize(r, UBound(Arr2, 2)) = Arr2
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把这些全部选中,文字方向,竖向改成横向
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
对不起,不知道。我是来学习的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询