- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-11-20 12:23 ½s¿è
¦^´_ 21# prince0413 - Const ¦ = "10:00~18:00"
- Const ¥þ¤é = "10:30~18:30"
- Const ±ß = "11:00~19:00"
- Sub Ex()
- Dim Rng(1 To 3) As Range, i As Integer, ii As Integer, ¥X¶Ô As String, ¤é´Á As Range, Print_x As Integer
- Dim ¥X¶Ô³æ As Range, E As Range
- Set ¥X¶Ô³æ = Sheets("°²¤é¥X¶Ô³æ").Range("B3,D3,A5,B5,D5") '²Ä1±i¥X¶Ô³æn¾É¤J¸ê®Æªº¦ì¸m
- For i = 0 To 3 '¥X¶Ô³æ: ²Ä1±i¨ì ²Ä4±iªº¦ì¸m ¶¡®æ 14 ¦C
- ¥X¶Ô³æ.Offset(i * 14) = "" '²M°£ ¸ê®Æ
- '************ ¦ý²Ä 2- 3±i¥X¶Ô³æ ¶¡®æ 15 ¦C §A»Ý½Õ¾ã¤@¤U *************************************
- Next
- Print_x = 0 '¦L¦C A4¯È±i ªºÅܼÆ
- Set Rng(1) = Sheets("°²¤é¥X¶Ô³æ").Range("J2") '³]©wªÀû ^¤å,¤¤¤å,½s¸¹ (¥i¥H¬O Abby,¤B¤dªå,136)
- Do While Rng(1) <> "" '°õ¦æ°j°éªº±ø¥ó: ªÀû<>""
- With Sheets("11¤ë")
- Set Rng(3) = Nothing 'ª«¥ó: ÄÀ©ñ
- Set Rng(2) = Sheets("¤¤^¤å©m¦W¹ï·Óªí").Range("A:C").Find(Rng(1), LOOKAT:=xlWhole)
- '^¤å,¤¤¤å,½s¸¹:¸Ì·j´M
- If Not Rng(2) Is Nothing Then
- Set Rng(2) = Rng(2).Parent.Range("A" & Rng(2).Row) '^¤å,¤¤¤å,½s¸¹ªº²Ä¤@Äæ (^¤å)
- For i = 1 To 3 '¦pªÀû¬°¤¤¤å Sheets("11¤ë")¨S¦³ ¤¤¤å
- Set Rng(3) = Sheets("11¤ë").Range("A:B").Find(Rng(2).Cells(i), LOOKAT:=xlWhole)
- If Not Rng(3) Is Nothing Then Exit For '§ä¨ì ^¤å ©Î ½s¸¹
- Next
- End If
- If Not Rng(3) Is Nothing Then
- i = 3 '²Ä3Äæ :C
- Do While IsNumeric(.Cells(4, i)) '°õ¦æ°j°éªº±ø¥ó:²Ä4¦C¬O¼Æ¦r
- If (.Cells(5, i) = "¤»" Or .Cells(5, i) = "¤é") And Trim(.Cells(Rng(3).Row, i)) <> "" Then
- ¥X¶Ô = "" 'Âk¹s
- Set ¤é´Á = .Cells(4, i)
- If .Cells(Rng(3).Row, i) Like "*¦*" Then
- ¥X¶Ô = ¦
- ElseIf .Cells(Rng(3).Row, i) Like "*±ß*" Then
- ¥X¶Ô = ±ß
- ElseIf .Cells(Rng(3).Row, i) Like "*¥þ¤é*" Then
- ¥X¶Ô = ¥þ¤é
- End If
- If ¥X¶Ô <> "" Then '¹w¨¾¨S¦³ [¥þ¤é,¦,±ß]ªº¯Z§O
- Print_x = IIf(Print_x = 4, 1, Print_x + 1)
- With ¥X¶Ô³æ.Offset((Print_x - 1) * 14) '²Ä Print_x ªº¦ì¸m
- .Range("A1") = Rng(2).Offset(, 1) 'ªÀû¤¤¤å
- .Range("C1") = Rng(2).Offset(, 2) 'ªÀû½s¸¹
- .Cells(3, 0) = DateSerial(2013, 11, ¤é´Á) '¤é´Á
- .Range("A3") = ¥X¶Ô '®É¶¡
- .Range("C3") = IIf(¤é´Á.Offset(1) = "¤»", "(¬P´Á¤»)", "(¬P´Á¤é)") & "¨FÀsÀç·~"
- End With
- If Print_x = 4 Then 'º¡4µ§¦L¦C
- ¥X¶Ô³æ.Parent.PrintOut '¦L¦C¥X¶Ô³æ
- For ii = 0 To 3
- ¥X¶Ô³æ.Offset(ii * 14) = "" '²MªÅ¤w¦L¦C¸ê®Æ
- Next
- End If
- End If
- End If
- i = i + 1
- Loop
- End If
- Rng(1).Offset(, 1) = IIf(Rng(3) Is Nothing, "½ÐÀˬd : °²¤é¥X¶Ô³æ , ¹ï·Óªí §ä¤£¨ì ", "")
- End With
- Set Rng(1) = Rng(1).Offset(1) '¤U¤@¦ì©m¦W
- Loop
- If Print_x > 0 And Print_x <= 3 Then ¥X¶Ô³æ.Parent.PrintOut 1, Round(Print_x / 2) ' ¥¼º¡ 4 µ§ªº¸ê®Æ¨S¦L¦C
- End Sub
½Æ»s¥N½X
|
|