怎么使用EXCEL实现数据的重复排列

excel

1个回答

写回答

18241100162

2025-10-14 08:55

+ 关注

AI
AI

打开工程管理器,或同来自时按下ALT+F11 插入模块 粘贴代码后运行 代码: Sub s() 京严实单Application.CutCopyMode = False With Sheet1 For i = .[A65536].End(xlUp).Row To 2 Step -1 If .Cells(i, 3) 1 Then .Rows(i + 1 & : & i + .Cells(i, 3) - 1).Insert Shift:=xlDown '批数量大于1,插入批数量空白行 .Range(.Cells(i, 1), .Cells(i, 12)).Copy '复制AI:Li .Range(A & i + 1 & :L & i + .Cells(i, 3) - 1).Select '选取插入的空白行 .Paste '贴上复制数据 End If Next i .Range(Cells(2, 6), Cells(.[A65536].End(xlUp).Row, 6)) = 1 '现数量填1 .Cells(1, 1).Select End With Application.CutCopyMode = True End Sub

举报有用(4分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号