Sub a()
For i = 1 To [A65536].End(xlUp).Row Step 4
Cells((i + 3) / 4, 2) = Cells(i, 1) & "," & Cells(1 + i, 1) & "," & Cells(2 + i, 1) & "," & Cells(3 + i, 1) & ","
Next
Cells.Select
Selection.Replace What:=",,", Replacement:=",", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:=",,", Replacement:=",", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
[A1].Select
End Sub
这段代码放到模块里,运行即可,只支持将当前活动的工作表A列数据按你的需求写入B列
执行这个a
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/d4628535e5dde711b88623f4abefce1b9d16615f?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/5882b2b7d0a20cf421299edd7a094b36acaf9972?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
追问请问您什么模块,在哪?
追答![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/c995d143ad4bd113f85ad43056afa40f4bfb0518?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
Alt+F11,插入一个模块,将上面的代码复制进去即可