|
代码更新一下。。。- Sub ykcbf() '//2024.4.29
- Set sh = ThisWorkbook.Sheets("总表")
- ReDim brr(1 To 10000, 1 To 12)
- For Each sht In Sheets
- If sht.Name <> sh.Name Then
- With sht
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 10)
- yf = Split(Replace(.[i5].Value, "/", "."), ".")(1) & "月份"
- For i = 7 To UBound(arr)
- If Val(arr(i, 2)) Then
- m = m + 1
- brr(m, 1) = .[a1]
- brr(m, 2) = .[i4]
- brr(m, 3) = .[i5]
- brr(m, 4) = CStr(arr(i, 2))
- For j = 3 To UBound(arr, 2)
- brr(m, j + 2) = arr(i, j)
- Next
- End If
- Next
- End With
- End If
- Next
- With sh
- .UsedRange.Offset(3) = ""
- .Columns(4).NumberFormatLocal = "@"
- .[e2] = yf
- .[a4].Resize(m, 12) = brr
- End With
- MsgBox "OK!"
- End Sub
复制代码
|
|