- ©«¤l
- 10
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 14
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOWS10
- ³nÅ骩¥»
- office2019
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2020-8-30
- ³Ì«áµn¿ý
- 2023-3-3
|
¦^´_ K0l1CHEN6
¦bExcel Home¤wµo°Ý¦n´X³q, µL¤H¦^À³,
À³¬O¨S¤HÀ´·N«ä,
¦³¼Æ¶qÄæ, ©Ò¥H"³æ»ù"¨Ì¤ñ ...
ã´£³¡ªL µoªí©ó 2020-10-10 11:52
¤p§Ì¦¨¥\¹Á¸Õ²¤¹L²Õ¦X§é¦©°µ¥[Á`¡A¤w¸g¤ÀÂ÷¨âӼƲÕ
¤ñ¸û¦³¹Á¸Õ¤£¤Fªº¬O¦p¦ó±N¨âÓ°}¦C¥h°µ¤ñ¹ï- Sub test1()
- Dim arr, brr(), t
- Set d = CreateObject("scripting.dictionary")
- arr = [A1].CurrentRegion
- ReDim brr(1 To UBound(arr), 1 To UBound(arr, 2)), t(UBound(arr, 2))
-
- For i = 2 To UBound(arr)
- If Not d.exists(arr(i, 2)) Then
- k = k + 1
- d(arr(i, 2)) = k
-
- For j = 1 To UBound(arr, 2)
- brr(k, j) = arr(i, j)
- Next
- Else
- r = d(arr(i, 2))
-
- For j = 6 To UBound(arr, 2)
- If arr(i, j) < 0 Then
- Else
- brr(r, j) = brr(r, j) + arr(i, j)
- End If
- Next
- End If
- Next
- For i = 1 To UBound(arr, 1) - 1
- If arr(i, 4) <> "²Õ¦X§é¦©" Then
- m = m + 1
-
- For j = 1 To UBound(arr, 2)
- arr(m, j) = arr(i, j)
- Next
-
- End If
- Next
-
- With [K1]
- .Resize(UBound(arr, 1), UBound(arr, 2)).ClearContents
- .Resize(m).NumberFormatLocal = "yyyymmdd"
- .Resize(m, UBound(arr, 2)) = arr
- End With
-
- [U2].Resize(k, 9) = brr
-
- End Sub
½Æ»s¥N½X |
|