⑴ 怎麼才能在excel中根據E列數值自動插入相應的空白行數並進行內容填充
For i = 2 To Range("e65536").End(xlUp).Row '循環E列內容
Cells(i + m, 3) = Cells(i + m, 4) 'D列內容填入C列
For y = 1 To Cells(i + m, 5) - 1 '循環插入
Rows(i + m & ":" & i + m).Select '選擇位置
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove '插入
Cells(i + m, 3) = Cells(i + m + 1, 4) 'D列內容填入C列
Cells(i + m, 1) = Cells(i + m + 1, 1)
Cells(i + m, 2) = Cells(i + m + 1, 2)
m = m + 1 '因為插入了行,循環到的位置要+1
Next y
Next i