- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2022-12-21 15:25 ½s¿è
¦^´_ 1# 013160
ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨ÒÀÉ®×
«á¾ÇÂǦ¹¥DÃD¾Ç²ß¨ì«Ü¦hª¾ÃÑ,¦ý¤£ª¾¬O§_²Å¦X«e½ú±¡¹Ò»Ý¨D,½Ð¸Õ¸Õ¬Ý
¿é¤Jµ¡: ¹w¥ý¸m¤J¤µ¤Ñ¤é´Á
«ö½T©w«á:
¿é¤J: 12/22
¿é¤J: 12/23
µ{¦¡½X¦p¤U:
Option Explicit
Sub ²Å¦X¦h±ø¥ó±a¥X¬ÛÃö¸ê°T_20221221_1()
Dim Arr(4), Brr, Crr, i&, Y, T
Dim Sh As Worksheet, Da, N&, j%, We
Set Y = CreateObject("Scripting.Dictionary")
Set Sh = ActiveSheet
Brr = Range(Sh.[A1], Sh.UsedRange)
Da = InputBox("½Ð¿é¤J ¤é´Á!", "²Å¦X¦h±ø¥ó±a¥X¬ÛÃö¸ê°T", Date)
If Not IsDate(Da) Then Exit Sub
We = Right(Format(Da, "aaaa"), 1)
T = Array(5, 1, 2, 3, 4)
For i = 2 To UBound(Brr)
If Trim(Brr(i, 3)) = "" Then Exit For
If InStr(Brr(i, 3), We) Then
If N = 0 Then
Crr = Arr
For j = 0 To UBound(T)
Crr(j) = Brr(1, T(j))
Next
N = N + 1
Y(N) = Crr
End If
N = N + 1
Crr = Arr
For j = 0 To UBound(T)
Crr(j) = Brr(i, T(j))
Next
Y(N) = Crr
End If
Next
If N = 0 Then Exit Sub
Workbooks.Add
[A2].Resize(N, UBound(Arr) + 1) = Application.Transpose(Application.Transpose(Y.ITEMS))
Range([A1], ActiveSheet.UsedRange).Borders.LineStyle = 1
Cells.Columns.AutoFit
[2:2].Font.Bold = True
[A1].NumberFormatLocal = "m""¤ë""d""¤é"";@"
[A1] = Da: [B1] = We
Set Y = Nothing
Set Brr = Nothing
Erase Crr, Arr
End Sub |
|