- ©«¤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
|
¨D§U°}¦C°ÝÃD¡A¤p§Ì¹Á¸Õ¹L¦ýµLªk¥¿½T¤À²Õ°}¦C¥[Á`¡AÁٽШD¦U¦ì¤j¤j¨ó§U¡AÁÂÁ¡I- Sub test()
- Dim arr, i, j, k, m, n, p
- arr = [A1].CurrentRegion.Offset(1).Resize(, 9).Value
- ReDim Sum(UBound(arr, 2)), t(UBound(arr, 2))
-
-
- For i = 1 To UBound(arr, 1) - 1
-
- If arr(i, 2) <> arr(i + 1, 2) Then
-
- For j = 6 To UBound(arr, 2)
- Sum(j) = Sum(j)
- Debug.Print Sum(j)
- Next
- Else
- For j = 6 To UBound(arr, 2)
- Sum(j) = Sum(j) + arr(i, j)
- Debug.Print Sum(j)
- Next
- End If
-
- If arr(i + 1, 4) = "²Õ¦X§é¦©" Then
- For j = p + 1 To i - 1
- For k = 6 To UBound(arr, 2)
- n = Round(-arr(i + 1, k) / Sum(k) * arr(j, k), 0)
- arr(j, k) = arr(j, k) - n
- t(k) = t(k) + n
- Next
- Next
-
- For k = 6 To UBound(arr, 2)
- arr(j, k) = arr(j, k) + arr(i + 1, k) + t(k)
- Sum(k) = 0: t(k) = 0
- Next
-
- i = i + 1: p = i
- 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 [l2]
- .Resize(UBound(arr, 1), UBound(arr, 2)).ClearContents
- .Resize(m).NumberFormatLocal = "yyyymmdd"
- .Resize(m, UBound(arr, 2)) = arr
- End With
-
- End Sub
½Æ»s¥N½X |
-
-
2020-10-06_190331.png
(121.45 KB)
-
-
test1.rar
(13.87 KB)
¼ÒÀÀ¤å¥ó
|