- ©«¤l
- 88
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 104
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN7
- ³nÅ骩¥»
- OFFICE2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-1-3
- ³Ì«áµn¿ý
- 2017-12-31
|
[µo°Ý] ¡¹½Ð±Ð¦U¦ì vba¾ã²z¼Æ¾Ú°ÝÃD¡A®Ú¾Ú±ø¥ó¡A¶}¯S©w·sÀÉ¡A¶KÀÉ¡AÀx¦s¡A¦A±ø¥ó§PÂ_ªº°ÝÃD
¦b¤U¤~è¾Çvba¤£¤[¡A¥Ñ©ó°ÝÃD¤@ª½¸Ñ¤£¥X¨Ó¡A¥u¯à§¹¦¨³¡¥÷µ{¦¡½X¡A©Ò¥H¨Ó½Ð±Ðª©¤W¦U¦ì¡C Àɮצp³Ì«á¤@¦æªºªþ¥ó¡G
µ{¦¡½X²z¡G
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Sub §¹¾ã¥h§ì²Å¦X±ø¥óªº¸ê®Æ¤£Â_©¹¤U¶KªºÂù°j°é¥Îªk()
Worksheets("¿ï¾ÜÅv¾ã²z®æ¦¡").Copy after:=Worksheets(Worksheets.Count) '±N½Ð´Ú®Ñ쫬sheet¡A½Æ»s¨ì¤u§@ªí3«á±¡A.count´N¥NªíÄݩʳ]¬°.name
Worksheets(Worksheets.Count).Name = "2011_1_6900" '±N·s¼Wsheetªº¦WºÙ³]©w¬°a¤½¥q¡A³sÄò«öf5·|¿ù»~¡A¦]¤w³]©w¦WºÙ
Dim i As Double ' ¤u§@ªí1 ¥Îªºp¼Æ¾¹ÅܼÆ
Dim x As Double ' 1¤ë¿ï¾ÜÅv ¤u§@ªí¥Îªºp¼Æ¾¹ÅܼÆ
Dim sheets1 As Range 'ì©l¿ï¾ÜÅvªº¤u§@ªí1ªí®æªº°ò·ÇÂI
Dim month1data As Range '1¤ë¿ï¾ÜÅv¾ã²z«á ¤u§@ªí ªº°ò·ÇÂIÀx¦s®æ
x = 2 '³]©w¦n°ò·ÇÂI´N¤£¥Î³]¬°2¡A¦]1¤ë¿ï¾ÜÅv ¤u§@ªí¬O±q²Ä2¦C¶}©l¶K¸ê®Æ¡A±N2©ñ¦bxÅܼÆ
Set sheetsx = Worksheets("¤u§@ªí1").Range("A2")
Set month1data = Worksheets("2011_1_6900").Range("A2")
'±N¿z¿ïªºì©l¿ï¾ÜÅv¸ê®Æ½Æ»s¨ì 1¤ë¿ï¾ÜÅv ¤u§@ªí
For i = 1 To sheetsx.CurrentRegion.Rows.Count '±qa2¨ì³Ì«á¤@Äæ¡A«Å§iì©l¿ï¾ÜÅv¸ê®Æ ¦C¼Æªº°j°é
If Worksheets("¤u§@ªí1").Cells(i, 4).Value = "6900" Then '¦pªG¼i¬ù»ù¬°6900«h¶i¦æ
Worksheets("2011_1_6900").Cells(x, 1).Value = Worksheets("¤u§@ªí1").Cells(i, 1).Value '¥æ©ö¤é´Á
Worksheets("2011_1_6900").Cells(x, 2).Value = Worksheets("¤u§@ªí1").Cells(i, 2).Value '«´¬ù
Worksheets("2011_1_6900").Cells(x, 3).Value = Worksheets("¤u§@ªí1").Cells(i, 3).Value '¥æ³Î¤ë¥÷
Worksheets("2011_1_6900").Cells(x, 4).Value = Worksheets("¤u§@ªí1").Cells(i, 4).Value '¼i¬ù»ù
Worksheets("2011_1_6900").Cells(x, 5).Value = Worksheets("¤u§@ªí1").Cells(i, 5).Value '¶R½æÅv
Worksheets("2011_1_6900").Cells(x, 6).Value = Worksheets("¤u§@ªí1").Cells(i, 6).Value '¶}½L»ù
Worksheets("2011_1_6900").Cells(x, 7).Value = Worksheets("¤u§@ªí1").Cells(i, 7).Value '³Ì°ª»ù
Worksheets("2011_1_6900").Cells(x, 8).Value = Worksheets("¤u§@ªí1").Cells(i, 8).Value '³Ì§C»ù
Worksheets("2011_1_6900").Cells(x, 9).Value = Worksheets("¤u§@ªí1").Cells(i, 9).Value '¦¬½L»ù
Worksheets("2011_1_6900").Cells(x, 10).Value = Worksheets("¤u§@ªí1").Cells(i, 10).Value '¦¨¥æ¶q
Worksheets("2011_1_6900").Cells(x, 11).Value = Worksheets("¤u§@ªí1").Cells(i, 11).Value 'µ²ºâ»ù
Worksheets("2011_1_6900").Cells(x, 12).Value = Worksheets("¤u§@ªí1").Cells(i, 12).Value '¥¼¨R¾P«´¬ù¼Æ
Worksheets("2011_1_6900").Cells(x, 13).Value = Worksheets("¤u§@ªí1").Cells(i, 13).Value '³Ì«á¶R¶i»ù®æ
Worksheets("2011_1_6900").Cells(x, 14).Value = Worksheets("¤u§@ªí1").Cells(i, 14).Value '³Ì«á½æ¥X»ù®æ
x = x + 1 'Åý1¤ë¿ï¾ÜÅv¤u§@ªí¤u§@ªíªº½Æ»s¦ì¸m¦V¤U²¾°Ê¤@¦C
End If
Next i
End Sub
-----------------------------------------------------------------------------------------------------------------------------
»¡©ú¡G¤u§@ªí1¬°2011¦~1¤ë¿ï¾ÜÅv«´¬ù¡A2011_6900¤u§@ªí¬°§Ú¼gµ{¦¡«á¾ã²z¦nªº¸ê®Æµ²ªG
¤W±³o¬qµ{¦¡½X¥i¥H§â"¤u§@ªí1"¸Ì ¿z¿ï¥X ¼i¬ù»ù¬°"6900"ªº¤@¾ã¦C ½Æ»s¥X¨Ó¡A¶K¨ì§Ú·s¼Wªº¤u§@ªí¡C
¦ý¬O°ÝÃD1¬°¡G§Ú²{¦b¥u¯à§â¦³"6900"ªº¸ê®Æ§ì¥X¨Ó¡A¦ý¬O§ÚÁÙ¦³7000¡A7100¡D¡D¡D¨ì10200¡A³o¼Ë·|¤Ó¦h¡C
°ÝÃD2¬°¡G§Ú¥u¯à°µ¨ì¥Îµ{¦¡¿z¿ï¥X§Únªº¸ê®Æ¡A¶K¨ì«ü©wªº¤u§@ªí¡C
¡u¦ý§Ú·Q°µªº¬O1 µ{¦¡±½¨ì"6900"&"¶RÅv"¡v
2 °¨¤W¶}¤@Ó·sexcel ÀɦW¬°¡G 2011_1_6900_C.xls
3 §âì¤u§@ªí¿z¿ï¥X²Å¦X"6900"&"¶RÅv"±ø¥óªº¦C¸ê®Æ¥þ³¡½Æ»s¡A¶K¨ì
2011_1_6900_C.xls
4 ±N2011_1_6900_C.xls Àx¦s¡AÃöÀÉ
5 µ{¦¡¤S±½¨ì"7000"&"¶RÅv"
6 °¨¤W¶}¤@Ó·sexcel ÀɦW¬°¡G 2011_1_7000_C.xls
7 ¦P¨BÆJ3©M4
8 Ä~Äò±½7100¨ì10200¡A»P¤Wz°µªk¬Û¦P
³Ì«á·|·s¼W²£¥Í2011_1_6900_C.xls ¨ì2011_1_10200_C.xls¡A¦@¦³¤¤QÓxlsÀÉ¥ª¥k
¥t¥~ÁÙ¦³½æÅvªº¸ê®Æ¤]»Ýn¾ã²z¥X¨Ó¡A©Ò¥HÁÙ¦³ 2011_1_6900_P.xls ¨ì2011_1_10200_P.xls ¤]¤j·§¤¤QÓxlsÀÉ¥ª¥k
µ²ªG¬°2011_1ªº¸ê®Æ§¨¸Ì·|¦³2011_1_c¸ò2011_1_p¨âÓ¸ê®Æ§¨¡A2011_1_c¸ê®Æ§¨¸Ì¦³2011_1_6900_C.xls ¨ì2011_1_10200_C.xls¡A¦@¦³¤¤QÓxlsÀÉ¥ª¥k¡A2011_1_6900_p¸Ì¥H¦¹Ãþ±À¡C
¦p¦¹¤@¨Ó´N§¹¦¨2011¦~1¤ëªº¸ê®Æ¾ã²z¡AÁÙ¦³2¤ë¨ì12¤ë¡D¡D¡D
¸Õ¤F«Ü¤[µLªk¦¨¥\¤~¦V¤j®a½Ð¯q¡C¤å³¹¦³ÂIªø¡A¥ýÁÂÁ¦U¦ì¤F¡C
Àɮצpªþ¥ó¡G
2011¦~ªñ¤ë¿ï¾ÜÅv.rar (326.36 KB)
|
|