ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý ARRAY½d³ò §ï¦¨ °ÊºA «ü©w ½d³ò°ÝÃD ½Ð«e½ú­Ì«ü±Ð

½Ð°Ý­ã´£¤j¤j¡@¦pªG­n³]©w´X½ü¤W¡@©]¯Z¡@¤é¯Z¡@°²³]¤@½ü¬O¢°¢±¤Ñ
¸Ó¦p¦ó¼g©O¡H
·Ç´£¤j¤jªºª©¥»¡@±Æª©§ó¬O²M·¡¡@¦ý§ÚÀ³¸Ó¦b­þ¤@¬q­×§ï¡@­n«ç»ò¼g¡H¡@

¥H¤U¬O¤§«e­×§ï¹Lªº¡@¦ý¹ï§Ú¨Ó»¡¤w¸g¬O·¥­­¤F¡D¡D¹ê¦b·Q¤£¥X¨Ó¡@¡ÖÈСÕ
°ÝÃD¥X¦b³o¸Ì¡G
¦pªG¥Î¡@ÈУ@£@ÈС@¶g¼Æ­pºâ¤W¯Zªº¤Ñ¼Æ´N·|¦³°ÝÃD¡D¡D¤£ª¾¦p¦ó­×§ï¡@
ÈТìÈФѼƷ|·f¤£¨ì¡@¡@
        Select Case DateAdd("d", -1, K) Mod Cells(1, 3) + 1   '±`¤é¯Z
        Case 1 To Cells(1, 4)
            G.Offset = "¤W¯Z"
            G.Offset.Font.Color = RGB(0, 0, 89)
            G.Interior.Color = RGB(150, 201, 123)
        Case Cells(1, 4) + 1 To Cells(1, 4) + Cells(1, 5)
            If G.Offset >= Cells(1, 1) Then
            G.Offset = "¥ð°²"
            G.Offset.Font.Color = RGB(114, 0, 55)
            G.Offset.Interior.Color = RGB(255, 255, 92)
            End If
        End Select
        
        Select Case DateAdd("d", -1, K) Mod Cells(1, 7) + 1 '©P½ü¯Z
        Case 1 To Cells(1, 4)
            G.Offset = "©]¯Z"
            G.Offset.Font.Color = RGB(114, 0, 55)
            G.Offset.Interior.Color = RGB(255, 208, 0)
        Case Cells(1, 4) + 1 To Cells(1, 4) + Cells(1, 5)
        End Select
¡@¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð¡Ð
  1. Public Sub ©P½ü¯Z½m²ß()
  2. Range(Cells(2, 1).End(xlToRight), Cells(2, 1).End(xlDown)).Clear
  3. Cells(1, 3) = Cells(1, 4) + Cells(1, 5)
  4. Cells(1, 7) = Cells(1, 3) * 2
  5.    If Cells(1, 2) = "" Then
  6.       Cells(1, 2) = Year(Date)
  7.    Else
  8.       Cells(1, 2) = Cells(1, 2)
  9.    End If

  10.     S = 3
  11.     E = 1
  12.     For F = 1 To 12 '«Ø¥ß½d³ò
  13.         For P = 1 To Day(DateSerial(Cells(1, 2), F + 1, 0))
  14.             Cells(S, E) = DateSerial(Cells(1, 2), F, P)
  15.             Cells(S - 1, E) = F & "¤ë" & P & "¤é" & WeekdayName(Weekday(P))
  16.             E = E + 1
  17.             If P = Day(DateSerial(Cells(1, 2), F + 1, 0)) Then
  18.             If F = 12 Then Exit For
  19.                S = S + 2
  20.                E = 1
  21.             End If
  22.         Next P
  23.     Next F
  24.    
  25.     For E = ActiveWorkbook.Names.Count To 1 Step -1 '²M°£©w¸q¦WºÙ
  26.        If ActiveWorkbook.Names(E).Name <> "" Then
  27.           ActiveWorkbook.Names(E).Delete
  28.        End If
  29.     Next E
  30.    
  31.     Y = 65
  32.     For i = 3 To Cells(3, 1).End(xlDown).Row Step 2 '©w¸q¦WºÙ
  33.         ½d³ò¦WºÙ = Chr(Y)
  34.         Names.Add Name:="²Ä" & ½d³ò¦WºÙ & "¶µ", RefersTo:=Range(Cells(i, 1), Cells(i, 1).End(xlToRight))
  35.         Y = Y + 1
  36.     Next i
  37.    
  38.     Set AWN = ActiveWorkbook.Names '¦X¨Ö
  39.     For R = 1 To AWN.Count
  40.        If R <> 1 Then
  41.           K = Mid(AWN(R).RefersToR1C1Local, 2, Len(AWN(R))) & ","
  42.        Else
  43.           K = AWN(R).RefersToR1C1Local & ","
  44.        End If
  45.         U = U + K
  46.     Next R
  47.     Names.Add Name:="«ü©w½d³ò", RefersTo:=Mid(U, 1, Len(U) - 1)
  48.    
  49.     For E = ActiveWorkbook.Names.Count To 1 Step -1 '²M°£©w¸q¦WºÙ
  50.        If ActiveWorkbook.Names(E).Name <> "«ü©w½d³ò" Then
  51.           ActiveWorkbook.Names(E).Delete
  52.        End If
  53.     Next E
  54.    
  55.    If Cells(1, 1) = "" Then
  56.       Cells(1, 1) = Cells(3, 1)
  57.    Else
  58.       Cells(1, 1) = Cells(1, 1)
  59.    End If
  60.    
  61.     D = Cells(1, 1)
  62.    
  63.     For Each G In Range("«ü©w½d³ò") '©P½ü¯Z
  64.     If G.Offset >= Cells(1, 1) Then
  65.         If Weekday(G) = 1 Or Weekday(G) = 7 Then '¤»¤é¤W¦â
  66.            G.Offset(-1, 0).Interior.Color = RGB(172, 199, 213)
  67.         End If
  68.    
  69.         K = G.Offset
  70.         
  71.         Select Case DateAdd("d", -1, K) Mod 6 + 1   '±`¤é¯Z
  72.         Case 1 To 4
  73.             G.Offset = "¤W¯Z"
  74.             G.Offset.Font.Color = RGB(0, 0, 89)
  75.             G.Interior.Color = RGB(150, 201, 123)
  76.         Case 5 To 6
  77.             If G.Offset >= Cells(1, 1) Then
  78.             G.Offset = "¥ð°²"
  79.             G.Offset.Font.Color = RGB(114, 0, 55)
  80.             G.Offset.Interior.Color = RGB(255, 255, 92)
  81.             End If
  82.         End Select
  83.         
  84.         Select Case DateAdd("d", -1, K) Mod 12 + 1 '©P½ü¯Z
  85.         Case 1 To 4
  86.             G.Offset = "©]¯Z"
  87.             G.Offset.Font.Color = RGB(114, 0, 55)
  88.             G.Offset.Interior.Color = RGB(255, 208, 0)
  89.         Case 5 To 6
  90.         End Select
  91.         
  92.     End If
  93.     Next G
  94.    
  95. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ °a¤ªºµ ©ó 2020-6-29 02:29 ½s¿è

°ÝÃD¸Ñ¨M¤F >"< ¦ý¬O³o¼gªk ¨Ã¤£¬O«Ü¦n  
«á¨Ó·Q¥X¨Óªº¿ìªk¬O¥Î ÃC¦â ¥h°µ§PÂ_
¤é´Áªº­pºâ ¹ê¦b¨S¿ìªk...¯uªº·Q¤£¥X¨Ó
¦A§â³Ì«áªºÃC¦â¼Æ­È¥ý¦s¨ìÀx¦s®æ
§ó§ï¤U¤@¦~¤§«á ¦A§âÃC¦â¼Æ­È¦s¦^ÅܼÆ...
¹ê¦b·Q¤£¥X¿ìªkªº¿ìªk...  §Æ±æ¦³§ó¦nªº¿ìªk
·Ç´£¤j¤jªºª©¥» ±Æª©§ó¬O²M·¡¡@
¦ý§ÚÀ³¸Ó¦b­þ¤@¬q­×§ï¡@­n«ç»ò¼g¡H

TOP

ÁÂÁÂn7822123¤j¤jªº«üÂI Åý§Ú·Q¨ì §â -1 ªº¦ì¸m§ï¤@¤U´N¥i¥H¤F
DateAdd("d", -1, K) Mod 12 + 1
¦Ñ¹ê»¡§Ú¯uªº¬Ý¤£À´  ¥u¯àF8 ºCºC¬ã¨sXD
·Ç¤jªºª©¥»¹ï§Ú¨Ó»¡¦n½ÆÂø ...¦pªG¦³¤£À´ªº¦a¤è ¦A½Ð±Ðn7822123¤j¤jÁÙ¦³¦U¦ì«e½ú­Ì ^^"

TOP

¥»©«³Ì«á¥Ñ °a¤ªºµ ©ó 2020-7-11 20:05 ½s¿è

½Ð°Ý ¦³Ãö©ó¤ë½ü¯Z  ¸ó¤ëªº³¡¤À°ÝÃD
·í¤@­Ó¤ë ªº³Ì«á¤@½ü ¨ì ¤U­Ó¤ëªº²Ä¤@½ü
¸Ó¥Î«ç»ò¼Ëªº§PÂ_¤è¦¡ ¤~¥i¥H§¹¾ãªº §â¤@¾ã½üªº¤Ñ¼Æ½ü§¹
¦Ó¤£·|¦]¬°¹j¤ëªº°ÝÃD ¾É­P ¿ù»~
¹Á¸Õ¤F­p¼Æªº¤è¦¡ ÁÙ¬O¤£¦æ ·|¥d¨ì¤ë¥÷°ÝÃD ¦³ªº¤ë¥÷¤Ñ¼Æ¤£¤@¼Ë
½Ð«e½ú­Ì À°À°¦£

§ïª©«áªº¯Zªí½m²ß.rar (20.09 KB)

TOP

°ÝÃD¸Ñ¨M¤F  ÁÂÁ·Ǵ£¤j¤jªºÀÉ®× ÁÙ¦³  n7822123¤j¤jªº ´£ÂI
«á¨Ó·Q¨ìªº¤è¦¡  ¬O§Q¥Î  False ¸ò True  ªº Boolean ÅܼƠ µM«á¦A§â ½ü¯ZªºÃC¦â¦¸¼Æ¥ý¦s¨ì Àx¦s®æ
¦A©µ¥Î ´N¥i¥H¤F XD
  1.                 If Y <= Cells(6, 11) Then
  2.                
  3.                     Select Case DateDiff("d", DateValue(d & "/1/1"), Cells(K, 1)) Mod Cells(5, 11) + 1
  4.                     Case 1 To Cells(3, 11)
  5.                     
  6.                     If Cells(1, 10) <> Year(Date) Then sss = True
  7.                     
  8.                     If yyy <> 0 And yyy <> Cells(3, 11) And sss = True Then
  9.                     
  10.                         Cells(U + 1, W) = "©]¯Z"
  11.                         Cells(U + 1, W).Font.Color = RGB(114, 0, 55)
  12.                         Cells(U + 1, W).Interior.Color = RGB(255, 208, 0)
  13.                         
  14.                         If Cells(U + 1, W) <> "¥ð°²" And Cells(U + 1, W) <> "¤W¯Z" Then yyy = yyy + 1
  15.                         Cells(1, 13) = yyy 'Àx¦s©µ¦ù¤Ñ¼Æ
  16.                         
  17.                         If yyy = Cells(3, 11) Then
  18.                            yyy = 0
  19.                            sss = False
  20.                         End If
  21.                         
  22.                     Else
  23.                         Cells(U + 1, W) = "¤W¯Z"
  24.                         Cells(U + 1, W).Font.Color = RGB(0, 0, 89)
  25.                         Cells(U + 1, W).Interior.Color = RGB(150, 201, 123)
  26.                     End If
  27.                     
  28.                         If Cells(U + 1, W) <> "¥ð°²" And Cells(U + 1, W) <> "©]¯Z" Then kkk = kkk + 1
  29.                         Cells(1, 12) = kkk 'Àx¦s©µ¦ù¤Ñ¼Æ
  30.                         If kkk = Cells(3, 11) Then kkk = 0
  31.                         
  32.                     End Select
  33.                     
  34.                 ElseIf Y <= Cells(6, 11) * 2 Then
  35.                
  36.                     Select Case DateDiff("d", DateValue(d & "/1/1"), Cells(K, 1)) Mod Cells(5, 11) + 1
  37.                     Case 1 To Cells(3, 11)
  38.                     
  39.                     If Cells(1, 10) <> Year(Date) Then sss = True
  40.                     
  41.                     If kkk <> 0 And kkk <> Cells(3, 11) And sss = True Then
  42.                         
  43.                         Cells(U + 1, W) = "¤W¯Z"
  44.                         Cells(U + 1, W).Font.Color = RGB(0, 0, 89)
  45.                         Cells(U + 1, W).Interior.Color = RGB(150, 201, 123)
  46.                         
  47.                         If Cells(U + 1, W) <> "¥ð°²" And Cells(U + 1, W) <> "©]¯Z" Then kkk = kkk + 1
  48.                         Cells(1, 12) = kkk 'Àx¦s©µ¦ù¤Ñ¼Æ

  49.                         If kkk = Cells(3, 11) Then
  50.                            kkk = 0
  51.                            sss = False
  52.                         End If
  53.                         
  54.                     Else
  55.                         Cells(U + 1, W) = "©]¯Z"
  56.                         Cells(U + 1, W).Font.Color = RGB(114, 0, 55)
  57.                         Cells(U + 1, W).Interior.Color = RGB(255, 208, 0)
  58.                     End If
  59.                     
  60.                         If Cells(U + 1, W) <> "¥ð°²" And Cells(U + 1, W) <> "¤W¯Z" Then yyy = yyy + 1
  61.                         Cells(1, 13) = yyy 'Àx¦s©µ¦ù¤Ñ¼Æ
  62.                         If yyy = Cells(3, 11) Then yyy = 0
  63.                            
  64.                     End Select
  65.                     
  66.                 End If
½Æ»s¥N½X
ÁÂÁ¤j¤j­Ìªº«ü¾É

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¤£¤@©w²y²y¬O¦n²y¡A¦ý¬O¦³¾ú½mªº±j¥´ªÌ¡AÀH®É³£¥i¥H´§´Î¡C
ªð¦^¦Cªí ¤W¤@¥DÃD