¼ÐÃD:
[µo°Ý]
±µÄò¦s¸ê®Æªº°ÝÃD(¤w¸Ñ¨M)
[¥´¦L¥»¶]
§@ªÌ:
jesscc
®É¶¡:
2011-5-15 16:40
¼ÐÃD:
±µÄò¦s¸ê®Æªº°ÝÃD(¤w¸Ñ¨M)
¥»©«³Ì«á¥Ñ jesscc ©ó 2011-5-15 21:18 ½s¿è
§Ú¤S¦³°ÝÃDn¥´ÂZ¦U¦ì¤F!
¦]¬°¾Þ§@¹Lµ{µy·L³Â·Ð¡A©Ò¥H¦bÀ£ÁYÀɤº¥tªþ»¡©ú
¦b¦¹¥ý²³æ»¡©ú¡A°ÝÃD©Ò¦b´N¬O:¦b¦P¤@Äæ¦ì±q¸ê®Æªº§ÀºÝ¡A±µÄò¶K·s¸ê®Æ¡C
[attach]6197[/attach]
§@ªÌ:
GBKEE
®É¶¡:
2011-5-15 21:06
¦^´_
1#
jesscc
Sub Ex()
Dim Wo As Workbook, Sh As Worksheet, Rng As Range
For Each Wo In Workbooks
If Wo.Name <> "SPECforMRPtest.xls" Then
For Each Sh In Wo.Sheets
With Workbooks("SPECforMRPtest.xls").Sheets("MRP").Cells(Rows.Count, "aw").End(xlUp).Offset(1)
Set Rng = Sh.Range(Sh.[d7], Sh.[d7].End(xlDown))
.Resize(Rng.Count, 1) = Rng.Value
.Offset(, 1).Resize(Rng.Count, 1) = Rng.Offset(, 4).Value
End With
Next
End If
Next
End Sub
½Æ»s¥N½X
§@ªÌ:
jesscc
®É¶¡:
2011-5-15 21:16
ÁÂÁ GBKEE ¤j¤j À°§Ú¸Ñ¨M°ÝÃD¡C
§Ú·d¤F¤@¤U¤È¡Aèè¤]¤~§ä¨ì°ÝÃD©Ò¦b¤F¡A¥un§â Ay2() ùتº¨ºÓ "s" ¥þ³¡´«¦¨¥t¤@Ó¥N¸¹´N¦n¤F¡C
§@ªÌ:
GBKEE
®É¶¡:
2011-5-16 07:51
¦^´_
3#
jesscc
¥un§â Ay2() ùتº¨ºÓ "s" ¥þ³¡´«¦¨¥t¤@Ó¥N¸¹´N¦n¤F¡C
³oÆ[©À¿ù»~
Dim Ay2()«Å§i¬°°ÊºA°}¦C
ReDim Preserve Ay2(s) Ä~©Ó«e±ªº S ·|¦³26Ó
ªÅ¥Õ¤¸¯À
Ay2(s) =Array(Cells(j, ar2(0)).Value, Cells(j, ar2(1)).Value) ¬O
¤@ºû°}¦C
©Ò¤@¸ê®Æ«¬ºA¤£²Å¦X
±NS³]¬°0 ¤§«á -> Ay2()¸Ìªº
¤¸¯À
¸ê®Æ«¬ºA¤~·|¤@P
'¨ú¥X Metal ¥X³f©ú²Ó
aw.Activate
Sheets("Metal").Activate
s = 0 ' ½Ð¦bµ{¦¡½X¥[¤W³o¦æ
Dim Ay2()
ar2 = Array("D", "H")
For j = 7 To Cells(Rows.Count, 2).End(3).Row
ReDim Preserve Ay2(s)
Ay2(s) = Array(Cells(j, ar2(0)).Value, Cells(j, ar2(1)).Value)
s = s + 1
Next
Workbooks("SPECforMRPtest.xls").Activate
With Sheets("MRP")
.Cells(.Rows.Count, 49).End(xlUp).Offset(1, 0).Resize(s, 2) = Application.Transpose(Application.Transpose(Ay2))
End With
End Sub
½Æ»s¥N½X
§@ªÌ:
jesscc
®É¶¡:
2011-5-16 21:53
GBKEE¤j¤j¦n:
"ReDim Preserve Ay2(s) Ä~©Ó«e±ªº S ·|¦³26Ӫťդ¸¯À"
³o¥y¸Ü§Ú·d¤£¤ÓÀ´¬O¤°»ò·N«ä¡A§Ú¬O³o¼Ë²qªº:
¦]¬°Ay1()ªº S ¤w¸g¦s¤J¤F26µ§¸ê®Æ¡A©Ò¥HAy2()¦P¼Ë¥H S ¬°¥N¸¹¡A´N·|±q²Ä27¶}©l¦s¸ê®Æ¡A¦]¦¹Ay1()©MAy2()ªº¸ê®Æ§ÎºA´N·|¤£¦P¡A¬O³oÓ·N«ä¶Ü?
´«¤@Ó¥N¸¹©M´¡¤Js = 0 ³o¨âªÌ¤S¦³¤°»ò®t§O©O?·Pı¦n¹³³£¦³Âk¹sªº·N«ä¹À¡C
¹ï§Ú³oºØªì¾ÇªÌ¨Ó»¡¡A³oºØ°ÝÃD¤w¸g«Ü²`¶ø¤F><
§@ªÌ:
GBKEE
®É¶¡:
2011-5-17 07:45
¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-5-17 07:50 ½s¿è
¦^´_
5#
jesscc
´«¤@Ó¥N¸¹©M´¡¤Js = 0 ³o¨âªÌ¤S¦³¤°»ò®t§O©O?·Pı¦n¹³³£¦³Âk¹sªº·N«ä¹À
¨S¦³®t§O¦ý´N¬OnÂk¹s.
'¨ú¥X Etrusion ¥X³f©ú²Ó
Sheets("Etrusion").Activate
Dim Ay1()
''
ReDim Preserve Ay1(s)
Ay1(s) = Array(Cells(i, ar1(0)).Value, Cells(i, ar1(1)).Value)
s = s + 1
Next
'
'¨ú¥X Metal ¥X³f©ú²Ó
µ{¦¡¶i¦æ¨ì¦¹ s=26
Dim Ay2()
ar2 = Array("D", "H")
For j = 7 To Cells(Rows.Count, 2).End(3).Row
ReDim Preserve Ay2(s) ' ·í j=7 ®É
Ay°t¸m26ÓµL¸ê®ÆªºÀx¦sªÅ¶¡
Ay2(s) = Array(Cells(j, ar2(0)).Value, Cells(j, ar2(1)).Value)
'Ayªº²Ä26Àx¦sªÅ¶¡¸ê®Æ¬°¤@ºû°}¦C ........(S=S+1)
s = s + 1
Next
Workbooks("SPECforMRPtest.xls").Activate
With Sheets("MRP")
.Cells(.Rows.Count, 49).End(xlUp).Offset(1, 0).Resize(s, 2) = Application.Transpose(Application.Transpose(Ay2))
'
¦]¦¹Ay1()©MAy2()ªº¸ê®Æ§ÎºA´N·|¤£¦P¡A¬O³oÓ·N«ä¶Ü?
¤£¬Oªº
'³Ì²×¤F Ay2¾ãÓ°}¦C¸Ì°ÑÂøªÅ¥Õ¤¸¯À¤Î¤@ºû°}¦C ¸ê®Æªº«¬ºA¤£¤@P µLªk©ñ¦b .Cells(.Rows.Count, 49).End(xlUp).Offset(1, 0).Resize(s, 2)
End With
Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)