|
楼主 |
发表于 2023-3-17 15:46
|
显示全部楼层
- Sub t() '生成喷码信息 Dim 1%
- With Sheets(21)
- m = .[b65536].End(3).Row
- arr1 = .[a2].Resize(m - 1, 1)
- arr3 = .[v2].Resize(m - 1, 1)
- arr4 = .[x2].Resize(m - 1, 1)
- arr5 = .[t2].Resize(m - 1, 1)
- arr6 = .[h2].Resize(m - 1, 1)
- arr7 = .[q2].Resize(m - 1, 1)
- arr = .[02].Resize(m - 1, 1)
- arr8 = arr
- ReDim arr2(1 To m - 1, 1 To 1)
- For i = 1 To UBound(arr)
- arr6(i, 1) = Replace(Replace(arr6(i, 1), ",", " "), "-", "")
- ss6 = Split("1" & " " & arr6(i, 1), " ")
- ss7 = Split("1" & " " & arr7(i, 1), " ")
- For j = 1 To UBound(ss6)
- If arr2(i, 1) = "" Then
- arr2(i, 1) = ss6(i) & ss7(i)
- If arr8(i, 1) = "" Then
- arr(i, 1) = "" & Format(arr3(i, 1), "yyyymmdd") & "" & ss6(j) & ss7(j)
- Else
- arr2(i, 1) = arr2(i, 1) & " " & ss6(j) & ss7(i)
- If arr8(i, 1) = "" Then
- arr(i, 1) = arr(i, 1) & "" & Format(arr3(i, 1), "yyyymmdd") & "" & ss6(i) & ss7(i)
- End If
- If arr4(i, 1) = 1 Then
- If arr8(i, 1) = "" Then
- arr(i, 1) = arr(i, 1) & "" & Format(arr3(i, 1), "yyyymmdd") & "" & arr1(i, 1)
- End If
- Next
- arr5(i, 1) = DateSerial(Year(Now()) + Val(arr5(i, 1)), Month(Now()), Day(Now()))
- Next
- [02].Resize(m - 1, 1) = arr
- [v2].Resize(m - 1.1) = arr5
- [s2].Resize(m - 1.1) = arr2
- End With
- End Sub
复制代码
next没有fot |
|