|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub lll()
Dim sht1 As Worksheet
Dim sht2 As Worksheet
Dim i As Integer, j As Integer, m As Integer, n As Integer
Set sht1 = Worksheets("玻璃汇总")
For Each sht2 In Sheets
If sht2.Name = sht2.Range("b16").Value Then
j = sht2.Cells(Rows.Count, "o").End(xlUp).Row
m = j - 37
For n = 1 To m
i = sht1.Cells(Rows.Count, 1).End(xlUp).Row
sht1.Cells(i + 1, 1) = sht2.Range("b16").Value
sht1.Cells(i + 1, 2) = Round(sht2.Cells(n + 37, "o").Value, 0)
sht1.Cells(i + 1, 3) = Round(sht2.Cells(n + 37, "p").Value, 0)
sht1.Cells(i + 1, 4) = sht2.Cells(n + 37, "q")
sht1.Cells(i + 1, 5) = sht2.Cells(n + 37, "r")
Next
End If
Next
End Sub
|
|