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

½Ð°ª¤â«üÂI¤@¤U¡A¦p¦ó°µ¥X°ÊºAªº¦æ¨Æ¾ä¤ÎÂùÀ»¿ï¾Ü¿é¤Jªº¥\¯à¡H

¦^´_ 3# GBKEE


ÁÂÁ¤j¤jªº¤j¤OÀ°¦£¡A§Ú¸ÕµÛ­×§ï¡A¥Ø«e¤w¸g¡y¤j­P¡zok¤F¡A

§Ú°Ñ¦Ò§Aªº½d¨Ò¡A­×§ïµ{¦¡

¦pªþ¥ó
https://dl.dropboxusercontent.com/u/12575824/%E8%A1%8C%E4%BA%8B%E6%9B%86.xls
  1. Option Explicit
  2. '¤u§@ªí¼Ò²Õ:ÂùÀ»Àx¦s®æµ{¦¡
  3. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  4. Dim aa As Integer

  5.         Cells(7, 2).Value = Target.Cells(1, 1)                'copy to B2
  6.         'Cells(7, 2).NumberFormatLocal = "G/³q¥Î®æ¦¡"

  7.         Ex Cells(7, 2), Target.Parent
  8. 'Target.Select
  9. End Sub

  10. Private Sub Ex(Rng As Range, sh As Worksheet)
  11.         Dim E As Range

  12.         If Rng = "" Then Exit Sub
  13.         If IsNumeric(Rng) Then
  14.                 Sheets("Sheet1").Activate
  15.                 If Selection.Row > 1 And Selection.Row < 52 And Selection.Column >= 6 And Selection.Column <= 7 Then
  16.                         Selection.Value = Rng
  17.                 End If
  18.         End If
  19. End Sub
½Æ»s¥N½X
¥[¨ì sheet ¤ë¾ä¤§¤¤¡A¨Ã¦b sheet1 ¤§¤¤¥[¤J
  1. Option Explicit
  2. '¤u§@ªí¼Ò²Õ:ÂùÀ»Àx¦s®æµ{¦¡
  3. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  4.         If Target.Cells(1).Row > 1 And Target.Cells(1).Row < 52 And Target.Cells(1).Column >= 6 And Target.Cells(1).Column <= 7 Then
  5.                 Sheets("¤ë¾ä").Activate
  6.         End If
  7. End Sub
½Æ»s¥N½X
¦p¦¹¤@¨Ó¡A§Ú«K¥i¥H¦b¨â­Ósheet ¤¤¡A¥Î ÂùÀ»°µ¤Á´«¡C¡]³o³¡¥÷¥\¯àok¤F¡A¤Q¤G¸U¤Àªº·PÁ¡^

²{¦b§Ú¤£¤F¸Ñªº¬O

¤@¡B­ì¥»´£¨Ñªºµ{¦¡¬O

Ex Target.Cells(1), Target.Parent

³o­Ó Target.Cells(1) §Ú«ç»ò§ï¡A³£§ï¤£¥X­ì©l­È¡]³£¬O¸g¹L®æ¦¡¤Æªº¸ê®Æ¡^¡A³Ì«á§Ú¨S§é¡A¥u¦n±N­È¼g¨ìb2 ¡A¦A±Nb2 ªº­È¥á¥X¨Ó¡]¬Ý¤£¨ì­È¬O¦]¬°¦r«¬ÃC¦â§Ú½Õ¾ã¥Õ¦â¡^

¤G¡B
­pºâ¤é´Á
=if(        month(OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,))<>
        month(OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,)-(weekday(        OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,),1)-1)+ MOD(ROW()-4,9)*7 +MOD(COLUMN()-2,8)),
        "",
        OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,)-(weekday(        OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,),1)-1)+ MOD(ROW()-4,9)*7 +MOD(COLUMN()-2,8))
³o­Ó¼ö¼öªøªºµ{¦¡¡A¦³¾÷·|ÁYµu¶Ü¡H ¡]¨Ò¦p¥Î ¦WºÙ ©w¸q¡^
¤½¶}¸gÅç¡A³Ð³y´¼¼z¡]§Ú¤S¤£¾a³o¹L¬¡¡^

TOP

¦^´_ 2# eigen
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. '¤u§@ªí¼Ò²Õ:ÂùÀ»Àx¦s®æµ{¦¡
  3. Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
  4.     Ex Target.Cells(1), Target.Parent
  5.     Target.Select
  6. End Sub

  7. Private Sub Ex(Rng As Range, sh As Worksheet)
  8.     Dim T_Date, T_Mon As Integer, TE As Date
  9.     Dim M As Integer, Week_Ar(), I As Integer
  10.     Week_Ar = Array("¤é", "¤@", "¤G", "¤T", "¥|", "¤­", "¤»")
  11.     Do Until IsDate(T_Date)
  12.         T_Date = InputBox("½Ð«ü©w¤é´Á", , Date)
  13.         If T_Date = "" Then Exit Sub
  14.     Loop
  15.     With sh
  16.         .Cells.Clear                            '²M°£¤u§@ªí
  17.         .Cells.HorizontalAlignment = xlCenter   'Àx¦s®æª«¥óªº¤ô¥­¹ï»ô¼Ò¦¡:¸m¤¤
  18.         .Cells.VerticalAlignment = xlCenter     'Àx¦s®æª«¥óªº««ª½¹ï»ô¼Ò¦¡:¸m¤¤
  19.     End With
  20.    
  21.     With Rng.Resize(, 7)                        '«ü©w¤é´Áªº®æ¦¡
  22.         .Merge                                  '¦X¨Ö: .Resize(, 7)
  23.         .Font.Size = 30
  24.         .Font.Bold = True
  25.         .Font.Color = vbBlue
  26.         .NumberFormatLocal = "yyyy-m-d"
  27.          Rng = T_Date                           '¤é´Á
  28.     End With
  29.     I = I + 3
  30.     For M = -1 To 1
  31.         T_Date = DateAdd("M", M, Rng.Cells(1))                           '¨ú±o«ü©w¤ë¥÷ªº¤é´Á
  32.         T_Date = DateSerial(Year(T_Date), Month(T_Date), 1)     '«ü©w¤ë¥÷¤é´Áªº 1¸¹¶}©l
  33.         T_Mon = Month(T_Date)                                   '«ü©wªº¤ë¥÷
  34.         With Rng.Cells(I).Resize(1, 7)                          '¼g¤J «ü©w¤ë¥÷ªº®æ¦¡
  35.             .Merge
  36.             .Cells = T_Date
  37.             .NumberFormatLocal = "yyyy-m"
  38.             .Font.Size = 15
  39.             .Font.Bold = True
  40.             .Font.Color = vbWhite
  41.             .Interior.Color = vbBlue
  42.         End With
  43.         I = I + 1
  44.         With Rng.Cells(I).Resize(, 7)                           '¼g¤J¬P´Áªº®æ¦¡
  45.             .Cells = Week_Ar
  46.             .Interior.ColorIndex = 15
  47.             .Range("A1,G1").Font.Color = vbRed
  48.         End With
  49.         I = I + 1
  50.         Do While T_Mon = Month(T_Date)                          '°j°éªº±ø¥ó:¦P¤@­Ó¤ë¥÷
  51.             With Rng.Cells(I, Weekday(T_Date))
  52.                 .Cells = T_Date
  53.                 .NumberFormatLocal = "D"
  54.                 If Weekday(T_Date) = 1 Or Weekday(T_Date) = 7 Then .Font.Color = vbRed
  55.             End With
  56.             If Weekday(T_Date) = 7 And T_Mon = Month(T_Date + 1) Then I = I + 1
  57.             T_Date = T_Date + 1                                 '¤é´Á¥[¤@¤Ñ
  58.         Loop
  59.         I = I + 2
  60.     Next
  61. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦pªþ¥ó
https://dl.dropboxusercontent.com/u/12575824/%E8%A1%8C%E4%BA%8B%E6%9B%86.xls

¨C­Ó¤ëªº²Ä¤@¤Ñ¡A§Ú¥Î =eomonth(TODAY(),quotient(COLUMN()-2,8)+quotient(ROW()-2,9)*4-5)+1 ¸Ñ¨M¤F

¨C­Ó¤ëªº¨C¤@¤Ñ¡A§Ú¥Î
                OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,)
-(weekday(        OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,),1)-1)
+ MOD(ROW()-4,9)*7
+MOD(COLUMN()-2,8)

¸Ñ¨M¤F
¬°¤F­n¦n¬Ý¡A¤S¥[¤W¤F
=if(        month(OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,))<>
        month(OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,)-(weekday(        OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,),1)-1)+ MOD(ROW()-4,9)*7 +MOD(COLUMN()-2,8)),
        "",
        OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,)-(weekday(        OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,),1)-1)+ MOD(ROW()-4,9)*7 +MOD(COLUMN()-2,8))



¡°²{¦bªº°ÝÃD
¤£Ãøµo²{¡A«ü¥O¤Óªø¤F¡A¤S¯ä¤Sªø
OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,)-(weekday(        OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,),1)-1)+ MOD(ROW()-4,9)*7 +MOD(COLUMN()-2,8)
¤Óªø¤F¡A§Ú­ì¥»·Q­n¥Î ´¡¤J->¦WºÙ->©w¸q ªº¤è¦¡¸Ñ¨M¡A¦ý¬O©w¸q month_first_day -->OFFSET($B$2,QUOTIENT(ROW()-4,9)*9,QUOTIENT(COLUMN()-2,8)*8,,)

¦A±N¨C¤éªº­pºâ¤½¦¡¼g¦¨
=if(        month(        month_first_day)<>
        month(        month_first_day-(weekday(        month_first_day,1)-1)+ MOD(ROW()-4,9)*7 +MOD(COLUMN()-2,8)),
        "",
                month_first_day-(weekday(        month_first_day,1)-1)+ MOD(ROW()-4,9)*7 +MOD(COLUMN()-2,8))

µLªk¨Ï¥Î¡A½Ð«ü±Ð¡B«üÂI¡AÁÂÁÂ
¤½¶}¸gÅç¡A³Ð³y´¼¼z¡]§Ú¤S¤£¾a³o¹L¬¡¡^

TOP

        ÀR«ä¦Û¦b : ¤£­nÀH¤ß©Ò±ý¡A­nÀH¤ß±Ð¨|¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD