- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2022-10-14 08:09 ½s¿è
¦^´_ 27# cclo0728
«e½ú¦¦w
«á¾Ç¦¤W½Æ²ß¤F©î¸Ñªø§Ç¸¹¼W¥[¨âÄæ©ñ¤J¤é´Á»Pµu§Ç¸¹
½m²ß°}¦C
´£¨Ñ«e½ú°Ñ¦Ò!
ì¥X³f¸ê®Æªø§Ç¸¹¿z¿ï:
°õ¦æµ{¦¡«á²£¥Í·sÀÉ®×¥i¿z¿ï¤é´Á:
·sÀÉ®×¥i¿z¿ïµu§Ç¸¹:
¥H¤U½Æ²ßªºµ{¦¡½X¨Ñ°Ñ¦Ò:
Option Explicit
Sub ªø§Ç¸¹Âà_¤é´Á_µu§Ç¸¹()
Dim Arr, i&, xB, N&, D1 As Date
'¡ô«Å§iÅܼÆ:D1 ¬O¤é´Á,N¬O¼Æ¦r
Set xB = Sheets("¥X³f¸ê®Æ")
'¡ô¥OxB¬O "¥X³f¸ê®Æ" ¤u§@ªí
Arr = xB.Range(xB.[J1], Cells(xB.UsedRange.EntireRow.Count, 1))
'¡ô¥OArr¬O"¥X³f¸ê®Æ" ¤u§@ªí A:GÄ椧¶¡¦³¨Ï¥Î¦Cªº°Ï°ìÀx¦s®æÈ
For i = 2 To UBound(Arr)
'¡ô³]°j°é©î¸ÑBÄ檺ªø§Ç¸¹
D1 = "20" & Mid(Arr(i, 2), 1, 2) & "/" & Mid(Arr(i, 2), 3, 2) & "/" & Mid(Arr(i, 2), 5, 2)
'¡ô "20",¥[ªø§Ç¸¹²Ä1Ó¦r¶}©l¨ú¨â¦r¤¸="22"
',¦A¥[ªø§Ç¸¹²Ä3Ó¦r¶}©l¨ú¨â¦r¤¸="10"
',¦A¥[ªø§Ç¸¹²Ä5Ó¦r¶}©l¨ú¨â¦r¤¸="08"
'D1="2022/10/08"¦r¦êÂà¤Æ¬°¤é´Á,¦]D1«Å§i¬°¤é´Á
Arr(i, 9) = D1
'¡ô§âD1¤é´Á©ñ¤JArrªº²Ä9Äæ¦ì¸m
N = Right(Arr(i, 2), 3)
'¡ô¥ON¬O±`§Ç¸¹ªº¥kÃä3Ó¦r¤¸¦r¦êÂà¼Æ¦r,¦]N«Å§i¬°¼Æ¦r
Arr(i, 10) = N
'¡ô§âN¼Æ¦r©ñ¤JArrªº²Ä10Äæ¦ì¸m
Next
Workbooks.Add
'¡ô¶}¤@Ó·sªºÀÉ®×
[A1].Resize(UBound(Arr), 10) = Arr
'¡ô§âArr°}¦Cªº¸ê®Æ±q[A1]¶}©lˤJ·s¤u§@ªíªº¦s®æ
[I1] = "¥X³f¤é´Á"
[J1] = "·í¤é§Ç¸¹"
Cells.Columns.AutoFit
'¡ô¦Û°Ê½Õ¾ãÄæ¼e
Cells.Rows.AutoFit
'¡ô¦Û°Ê½Õ¾ã¦C°ª
[2:2].Select
ActiveWindow.FreezePanes = True
'¡ô²Ä¤G¦C¥H¤WÀx¦s®æáµ²µ¡®æ
[A1].Select
[A1].AutoFilter
'¡ô³]©w¿z¿ï
Cells.Borders.LineStyle = xlContinuous
'¡ôÅã¥Ü®æ½u
End Sub |
|