excel表格例如内容是(行):1,2,3,4,5......如何能快速设置成(行):1,1,2,2,3,3,4,4,5,5,....
3个回答
展开全部
选中数据区域,按 ALT + F8 执行宏 Expand
宏代码:
Sub Expand()
Dim dt As String
dt = ""
For Each rg In Selection
dt = dt & rg.Value & " "
Next
a = Split(Trim(dt), " ")
c = 0
For Each rg In Selection
rr = rg.Row()
cc = 2 * rg.Column() - 1
Cells(rr, cc).Value = a(c)
Cells(rr, cc + 1).Value = a(c)
c = c + 1
Next
End Sub
宏代码:
Sub Expand()
Dim dt As String
dt = ""
For Each rg In Selection
dt = dt & rg.Value & " "
Next
a = Split(Trim(dt), " ")
c = 0
For Each rg In Selection
rr = rg.Row()
cc = 2 * rg.Column() - 1
Cells(rr, cc).Value = a(c)
Cells(rr, cc + 1).Value = a(c)
c = c + 1
Next
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
假设数据是在第一行,第二行输入公式
=OFFSET($A$1,,(COLUMN(A1)-1)/2) 右拉复制公式
=OFFSET($A$1,,(COLUMN(A1)-1)/2) 右拉复制公式
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询