qq_21322775
qq_21322775
采纳率66.7%
2019-03-22 21:51

excel如何把一行分成多行 大约是10行分成2个五行 不是在一个单元格里面的数据

图片说明
就如图中那个样子

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • caozhy 回答这么多问题就耍赖把我的积分一笔勾销了 2年前
    Sub Macro1()
    
    
        Dim tocell As String
        tocell = InputBox$("输出到哪一行", , "5")
        RowCount% = Val(InputBox$("分为几行", , "2"))
        colcount% = Selection.Count \ RowCount
        If Selection.Count Mod RowCount <> 0 Then colcount = colcount + 1
        currr = tocell
        currc = 0
        For Each r In Selection
            If currc = 0 Then currr = currr + 1
            currcidx = Chr(Asc("A") + currc)
            currc = currc + 1
            currc = currc Mod colcount
            Range(currcidx & currr) = r
        Next
    End Sub
    
    
    点赞 评论 复制链接分享