- ©«¤l
- 522
- ¥DÃD
- 36
- ºëµØ
- 1
- ¿n¤À
- 603
- ÂI¦W
- 0
- §@·~¨t²Î
- win xp sp3
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-12-13
- ³Ì«áµn¿ý
- 2021-7-11
|
¦^´_ 3# h60327
¦p¦ó»s§@¸õ¸¹½üȪí(§¹)
¥|¡B³Ì«áÁÙ¦³¤@Ó°ÝÃDn³B²z,
¨º´N¬O¡i³sÄò°²¤é¡jn¤£n³s±Æ¦P¤@¤H?
¦pªG¡i³sÄò°²¤én³s±Æ¦P¤@¤H¡j,
«hn¦A¼W¥[¤@±i¤u§@ªí¡÷¡i¤é´Áªí¡j,
§Y±Nì¤ë¾äªí(Á`ªí), Âà¿ý¦¨¡i¤é¬W¡j, ¥H¤è«KVBA¦s¨ú,
¡i«Ø¥ß¤é´Áªí¡jªºVBA Code ¦p¤U¡G- '«Ø¥ß¤é´Áªí
- '±N¡iÁ`ªí¡jªº ¤ë¾ä Âà´«¦¨¡i¤é´Áªí¡jªº¤é¬W
- Private Sub CommandButton1_Click()
- Dim sh1, sh2 As Worksheet
- Dim ¦~, ¤ë, i, j, k As Integer
-
- Set sh1 = Sheets("Á`ªí")
- Set sh2 = Sheets("¤é´Áªí")
-
- Application.ScreenUpdating = False 'Ãö³¬¿Ã¹õ¨ê·s
-
- '±q¡iÁ`ªí¡jªº¡i¤ë¾äªí¡j¨ú±o ¦~(¦è¤¸), ¨Ã¦s¤J sh2.[A2]
- sh2.[A2] = "=MID(Á`ªí!A2,3,4)"
-
- k = 1
- For ¤ë = 1 To 12
-
- '¤ë¾äªí¤W, ¨C¤ë¦³ 6 ¶g(¥]¬AªÅ¥Õ®æ)
- For i = 1 To 6
-
- '¤ë¾äªí¤W, ¨C¶g¦³ 7 ¤Ñ
- For j = 1 To 7
-
- '¦pªG¤ë¾äªí¤W¬OªÅ¥Õ®æ, ´«¤U¤@®æ
- If sh1.Cells(¤ë * 20 + i * 3 - 19, j) <> "" Then
-
- k = k + 1
-
- sh2.Cells(k, 2) = ¤ë
- sh1.Cells(¤ë * 20 + i * 3 - 19, j).Copy sh2.Cells(k, 3)
- sh1.Cells(¤ë * 20 + i * 3 - 18, j).Copy sh2.Cells(k, 4)
- sh2.Cells(k, 5) = DateSerial(sh2.[A2], ¤ë, sh2.Cells(k, 3))
- sh2.Cells(k, 6) = sh2.Cells(k, 5)
-
- End If
- Next
- Next
- Next
- sh2.[A1].Resize(367, 7).Font.Size = 12
- sh2.[A1].Resize(367, 7).Borders.LineStyle = 0
- Application.ScreenUpdating = True '¥´¶}¿Ã¹õ¨ê·s
- End Sub
½Æ»s¥N½X ¦p¤U¹Ï¡G
³Ì«á¦A¥[¤W
A¡B±Æ½üȪí(³sÄò°²¤é³s±Æ¦P¤@¤H)
vba Code ¦p¤U¡G- '°Æµ{¦¡
- Sub ½Æ»s¦W³æ¨ì¤é´Áªí(ByVal name1 As String, ByVal k As Integer)
- Dim sh, sh2 As Object
- Set sh = Sheets(name1)
- Set sh2 = Sheets("¤é´Áªí")
-
- 'Y [G2] ¬°ªÅ¥Õ®æ(«h ÄæG ¬°ªÅ¥ÕÄæ), ¦Ó [H2] ¤£¬OªÅ¥Õ®æ, «h
- If sh.[G2] = "" Then
-
- '§R°£ ÄæG, ¨Ã¦V¥ª²¾(¨ú±o ÄæH ªº¦W³æ)
- sh.[G2].Resize(row3, 1).Delete Shift:=xlToLeft
- End If
-
- '±N[G2]½Æ»s¨ì ¤é´Áªí
- sh.[G2].Copy
- sh2.Cells(k, 7).PasteSpecial Paste:=xlPasteValues
-
- '¨Ã±N [G2] §R°£¥B¦V¤W²¾¤@®æ
- sh.[G2].Delete xlUp
- End Sub
- '°Æµ{¦¡
- Sub ±q¤é´Áªí½Æ»s¦W³æ¨ìÁ`ªí()
- Dim sh1, sh2 As Object
- Dim i, j, k As Integer
- Dim cel As Range
-
- Set sh1 = Sheets("Á`ªí")
- Set sh2 = Sheets("¤é´Áªí")
-
- '¡i¤é´Áªí¡j¤¤, ±ý½Æ»s¨ì¡iÁ`ªí¡jªº¦W³æ ªº ©l¦C¸¹
- k = sh2.[J14]
-
- '±q ¤é´Áªí ½Æ»s¨ì Á`ªí
- For i = 1 To 6
- For j = 1 To 7
-
- Set cel = sh1.Cells(sh2.[J13] * 20 + i * 3 - 19, j)
-
- 'Y¤é´Á = "", «h´«¤U¤@Ó
- If cel <> "" Then
-
- cel.Offset(2, 0) = sh2.Cells(k, 7)
- End If
-
- k = k + 1
- Next
- Next i
- End Sub
½Æ»s¥N½X- '±Æ½üȪí(³sÄò°²¤é³s±Æ¦P¤@¤H)
- Private Sub CommandButton2_Click()
- Dim sh1, sh2, sh3, sh4 As Object
- Dim i, j, k, row3, row4 As Integer
- Dim cel As Range
-
- Set sh1 = Sheets("Á`ªí")
- Set sh2 = Sheets("¤é´Áªí")
- Set sh3 = Sheets("¥¤é")
- Set sh4 = Sheets("°²¤é")
-
- 'Y [G2] ¤Î [H2] ¬Ò¬°ªÅ¥Õ®æ, «h
- If sh4.[G2] = "" And sh4.[H2] = "" Then
- MsgBox "¤wµL¦W³æ¥i¥Î", vbExclamation
- Exit Sub
- End If
-
- Application.ScreenUpdating = False 'Ãö³¬¿Ã¹õ¨ê·s
-
- row3 = sh3.[A2].End(xlDown).Row
- row4 = sh4.[A2].End(xlDown).Row
-
- 'sh2.[J14] ª½±µ«ü¦V¡i¤é´Áªí¡j«ü©w¤ë¥÷ªº ¶}©l¦C¸¹
- sh2.[J14] = "=MATCH(J13,B2:B367,0) + 1"
- k = sh2.[J14]
-
- Do
-
- '³B²z¥¤é
- If sh2.Cells(k, 3).Font.ColorIndex = 1 Then
-
- ½Æ»s¦W³æ¨ì¤é´Áªí "¥¤é", k
-
- '³B²z°²¤é
- Else
-
- '¦pªG «e¤@¤Ñ ¤]¬O °²¤é, «h±q«e¤@¤Ñªº¦W³æ ½Æ»s¦W³æ
- If sh2.Cells(k - 1, 3).Font.ColorIndex = 3 _
- Or sh2.Cells(k - 1, 3).Font.ColorIndex = 5 Then
-
- If sh2.Cells(k - 1, 7) <> "" Then
- sh2.Cells(k, 7) = sh2.Cells(k - 1, 7)
-
- '¦ý, ¦pªG «e¤@¤Ñªº ¦W³æ ¬OªÅ¥Õ, «h¦Û "°²¤é" ªí¤¤, ½Æ»s¦W³æ
- Else
- ½Æ»s¦W³æ¨ì¤é´Áªí "°²¤é", k
- End If
-
- '§_«h, ¦Û "°²¤é" ªí¤¤, ½Æ»s¦W³æ
- Else
- ½Æ»s¦W³æ¨ì¤é´Áªí "°²¤é", k
- End If
- End If
-
- k = k + 1
- Loop Until sh2.Cells(k, 2) > sh2.[J13]
-
- ±q¤é´Áªí½Æ»s¦W³æ¨ìÁ`ªí
-
- Application.ScreenUpdating = True '¥´¶}¿Ã¹õ¨ê·s
- End Sub
½Æ»s¥N½X B¡B±Æ½üȪí(³sÄò°²¤é¤£³s±Æ¦P¤@¤H)
vba Code ¦p¤U¡G- '±Æ½üȪí(³sÄò°²¤é¤£³s±Æ¦P¤@¤H)
- Private Sub CommandButton3_Click()
- Dim sh1, sh2, sh3, sh4 As Object
- Dim i, j, k, row3, row4 As Integer
- Dim cel As Range
-
- Set sh1 = Sheets("Á`ªí")
- Set sh2 = Sheets("¤é´Áªí")
- Set sh3 = Sheets("¥¤é")
- Set sh4 = Sheets("°²¤é")
-
- 'Y [G2] ¤Î [H2] ¬Ò¬°ªÅ¥Õ®æ, «h
- If sh4.[G2] = "" And sh4.[H2] = "" Then
- MsgBox "¤wµL¦W³æ¥i¥Î", vbExclamation
- Exit Sub
- End If
-
- Application.ScreenUpdating = False 'Ãö³¬¿Ã¹õ¨ê·s
-
- row3 = sh3.[A2].End(xlDown).Row
- row4 = sh4.[A2].End(xlDown).Row
-
- 'sh2.[J14] ª½±µ«ü¦V¡i¤é´Áªí¡j«ü©w¤ë¥÷ªº ¶}©l¦C¸¹
- sh2.[J14] = "=MATCH(J13,B2:B367,0) + 1"
- k = sh2.[J14]
-
- Do
-
- 'Y ColorIndex = 1, «h¦Û¡i¥¤é¡jªí¤¤, ½Æ»s¦W³æ ¨ì¡i¤é´Áªí¡j
- If sh2.Cells(k, 3).Font.ColorIndex = 1 Then
-
- ½Æ»s¦W³æ¨ì¤é´Áªí "¥¤é", k
-
- '§_«h, ¦Û¡i°²¤é¡jªí¤¤, ½Æ»s¦W³æ ¨ì¡i¤é´Áªí¡j
- Else
-
- ½Æ»s¦W³æ¨ì¤é´Áªí "°²¤é", k
- End If
-
- k = k + 1
- Loop Until sh2.Cells(k, 2) > sh2.[J13]
-
- ±q¤é´Áªí½Æ»s¦W³æ¨ìÁ`ªí
-
- Application.ScreenUpdating = True '¥´¶}¿Ã¹õ¨ê·s
- End Sub
½Æ»s¥N½X OK, ¤j¥\§i¦¨, ¥i¥H´ú¸Õ¥h¤F¡C
¤£·Q¦Û¤v°Ê¤âªºªB¤Í, ³o¸Ì¦³¤@Ó²{¦¨ªºÀÉ®×,
¥i¤U¸ü¨Ó¸Õ¸Õ¬Ý¡G
http://www.mediafire.com/download/6ibnow9d2rk851g/%E8%B7%B3%E8%99%9F%E8%BC%AA%E5%80%BC%E8%A1%A8.7z
¶¶«KÀ°¦£´ú¸Õ, ÁÂÁÂ!! |
|