|
本帖最后由 z865593849 于 2024-10-23 16:22 编辑
- Sub a()
- With Sheets("Traceability_Data")
- Columns("C:ZZ").Delete
- Rows("6:999").Delete
- On Error Resume Next
- r = .Columns(1).Find(What:=[b1], LookAt:=xlWhole).Row
- [b2] = .Cells(r, 2)
- [b3] = .Cells(r, 3)
- [b4] = .Cells(r, 4)
- [b5] = .Cells(r, 5)
- i = 3 'item 列
- Do While .Cells(r, 1) = .Cells(r + 1, 1)
- Cells(5, i) = .Cells(r + 1, 5) '写item
- r = r + 1
- i = i + 1
- Loop
- For i = 1 To [b4].Value
- Cells(5 + i, 1) = i '根据数量写序号
- Next
- End With
- Range(Cells(5, 1), Cells(5 + [b4], [a5].End(xlToRight).Column)).Borders().LineStyle = xlContinuous '设置边框
-
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|