¼ÐÃD:
¨Ì«ü©wÄæ¦ì¤¤ªº¸ê®Æ¦Û°Ê§P©w¿é¤J¹ïÀ³ªºÀɮ׸ê®Æ¤¤???
[¥´¦L¥»¶]
§@ªÌ:
p6703
®É¶¡:
2012-7-11 09:13
¼ÐÃD:
¨Ì«ü©wÄæ¦ì¤¤ªº¸ê®Æ¦Û°Ê§P©w¿é¤J¹ïÀ³ªºÀɮ׸ê®Æ¤¤???
¤p§Ì©ó¤u§@·|¦³¤@q³æ©ú²Ó¤u§@ªí¡A§Æ±æ¥i¨Ìp¹ºû¡A¤À§O±N¨ä¸ê®Æ½Æ»s¦ÜA,B,C¤TÀɮפ¤¡]1202-->AÀÉ¡A1205-->BÀÉ¡A1206-->CÀÉ¡^¡AA~CÀɮפ¤ì§Y¤w¦³q³æ¸ê®Æ¡A·s¼Wªºq³æ¸ê®Æ»Ý·s¼W¥[¤J¡]¨Ò¡GìAÀɮפ¤¤w¦³100¦C¡A·s¥[¤Jªºq³æ¸ê®Æ»Ý¦Û°Ê§P©w±q101¦C¦Û°Ê¿é¤J¡^
¦ý«D¾ã¦C½Æ»s¡A¶È¦³³¡¥÷Äæ¦ì¸ê®Æ»Ý·s¼W¦Ü·s³øªí¡]¦p¤U¡A·s³øªí¤¤ªºC,G,JÄæ¦ì¬°¦Û¦æ¿é¤J¡ABÄæ¦ì¨Ì¨Ó·½¸ê®Æ¬°IS©ÎOS§Y¦Û°Ê¶ñ¤J2¡A§_«h¤@«ß¬°ªÅ¥Õ¡^
¦p¦ó¥H¥¨¶°§Ö³t¹F¦¨¦¹¤@¥Ø¼Ð¡A½Ð¦U¥ý±Ð«ü±Ð¡A¤p§Ì¦b¦¹¥ý«ôÁ¤F:lol :lol
¨Ó·½¸ê®ÆÄæ¦ì
C F J B D E H
·s³øªíÄæ¦ì
A B C D E F G H I J K
[attach]11637[/attach]
§@ªÌ:
GBKEE
®É¶¡:
2012-7-11 16:15
¦^´_
1#
p6703
¸Õ¸Õ¬Ý
Option Explicit
Sub Ex()
Dim D As Object, Ar(1 To 11), Ay(), xi As Integer, K, Wb As Workbook
Set D = CreateObject("Scripting.Dictionary")
xi = 2
With ThisWorkbook.Sheets("SHEET1")
Do While .Cells(xi, "M") <> ""
Ar(1) = .Cells(xi, "C") 'Ar(1)->Ar(11) = AÄæ:KÄæ
Ar(4) = .Cells(xi, "F") '«ü©w¤£³sÄòªºÄæ¦ì ¨ì«ü©w¦ì¸m
Ar(5) = .Cells(xi, "J")
Ar(6) = .Cells(xi, "B")
Ar(8) = .Cells(xi, "D")
Ar(9) = .Cells(xi, "E")
Ar(11) = .Cells(xi, "H")
If Not D.exists(.Cells(xi, "M").Value) Then '¦r¨åª«¥ó ªºKEY ¤£¦s¦b
D(.Cells(xi, "m").Value) = Array(Ar) '¦r¨åª«¥óªºitem «ü©w¬°°}¦C
Else '¦r¨åª«¥óªºKEY¦s¦b
Ay = D(.Cells(xi, "M").Value) 'Ay=¦r¨åª«¥óªºITEM
ReDim Preserve Ay(UBound(Ay) + 1) '°}¦Cªº¤¸¯À¤º®e¤£ÅÜ,·s¼W¤@Ó¤¸¯À
Ay(UBound(Ay)) = Ar '·s¼W¤@Ó¤¸¯À «ü©w¬° Ar
D(.Cells(xi, "m").Value) = Ay '¦r¨åª«¥óªºITEM=Ay°}¦C
End If
xi = xi + 1
Loop
End With
For Each K In D.keys
If K = 1202 Then Set Wb = Workbooks("A.xls") 'Àɮפw¶}±Ò
'If K = 1202 Then Set Wb = Workbooks.Open("¸ô®| \A.xls") 'ÀÉ®×¥¼¶}±Ò
If K = 1205 Then Set Wb = Workbooks("B.xls")
If K = 1206 Then Set Wb = Workbooks("C.xls")
xi = Application.CountA(Wb.Sheets(1).Range("A:A")) + 1
Ay = Application.Transpose(Application.Transpose(D(K)))
Wb.Sheets(1).Cells(xi, "A").Resize(UBound(Ay, 1), UBound(Ay, 2)) = Ay
Wb.Close True 'Ãö³¬ÀÉ®×: ¦sÀÉ
Next
End Sub
½Æ»s¥N½X
§@ªÌ:
p6703
®É¶¡:
2012-7-11 22:08
·PÁÂGBKEEª©¥D¡A¤p§Ì°õ¦æ«á¦³¤G°ÝÃD½Ð°Ý¡G
1.¥¼¶}±ÒÀɮת¬ªp¤U¡A·|³y¦¨¶]¥X¿ù»~°T®§¡G°õ¦æ¶¥¬q¿ù»~ 9':°}¦C¯Á¤Þ¶W¥X½d³ò¡A¬O§_¥i¦A³]©w§Y¨Ï¥¼¶}±Ò¤]¥i¦Û°Ê±N¸ê®Æ¼g¤J¡]©Î§P©w¥¼¶}¦Û°Ê¶}±Ò??¡^
2.BÄæ¦ì¨Ì¨Ó·½¸ê®Æ¬°IS©ÎOS§Y¦Û°Ê¶ñ¤J2¡A§_«h¤@«ß¬°ªÅ¥Õ¡]p¹ºû¬°1205ªº¦³¤@µ§OS¤ÎIS¡A§Æ±æ¥i©óBÄæ¦Û°Ê¶ñ¤J2¡^
Ãþ§O q³æ¸¹½X ¶µ¦¸ ®Æ¸¹ ¥¼µ²¼Æ¶q ¤U³æ¤é ¥æ´Á¦^ÂÐ¤é ¨ì´Á¤é ¤Ñ¼Æ «È¤á¥N½X «È¤á¦WºÙ ®w¦s¶q pµeû
OS AA12354 1 B 250,000.00 2012/7/8 2012/8/10 5465798 1205
IS AB123458 4 AA 158,789.00 2012/7/5 2012/8/13 4986798 1205
§@ªÌ:
GBKEE
®É¶¡:
2012-7-12 17:44
¦^´_
3#
p6703
Option Explicit
Sub Ex()
Dim D As Object, Dwb As String, Ar(1 To 11), Ay(), xi As Integer, K, Wb As Workbook
Dim W As Workbook
Set D = CreateObject("Scripting.Dictionary")
xi = 2
With ThisWorkbook.Sheets("SHEET1")
Do While .Cells(xi, "M") <> ""
Ar(1) = .Cells(xi, "C") 'Ar(1)->Ar(11) = AÄæ:KÄæ
Ar(2) = IIf(.Cells(xi, "A") = "OS" Or .Cells(xi, "A") = "IS", 2, "") 'Ar(1)->Ar(11) = AÄæ:KÄæ
'BÄæ¦ì¨Ì¨Ó·½¸ê®Æ¬°IS©ÎOS§Y¦Û°Ê¶ñ¤J2¡A§_«h¤@«ß¬°ªÅ¥Õ
Ar(4) = .Cells(xi, "F") '«ü©w¤£³sÄòªºÄæ¦ì ¨ì«ü©w¦ì¸m
Ar(5) = .Cells(xi, "J")
Ar(6) = .Cells(xi, "B")
Ar(8) = .Cells(xi, "D")
Ar(9) = .Cells(xi, "E")
Ar(11) = .Cells(xi, "H")
If Not D.exists(.Cells(xi, "M").Value) Then '¦r¨åª«¥ó ªºKEY ¤£¦s¦b
D(.Cells(xi, "m").Value) = Array(Ar) '¦r¨åª«¥óªºitem «ü©w¬°°}¦C
Else '¦r¨åª«¥óªºKEY¦s¦b
Ay = D(.Cells(xi, "M").Value) 'Ay=¦r¨åª«¥óªºITEM
ReDim Preserve Ay(UBound(Ay) + 1) '°}¦Cªº¤¸¯À¤º®e¤£ÅÜ,·s¼W¤@Ó¤¸¯À
Ay(UBound(Ay)) = Ar '·s¼W¤@Ó¤¸¯À «ü©w¬° Ar
D(.Cells(xi, "m").Value) = Ay '¦r¨åª«¥óªºITEM=Ay°}¦C
End If
xi = xi + 1
Loop
End With
For Each K In D.keys
If K = 1202 Then Dwb = "A.xls" '«ü©wÀÉ®×
If K = 1205 Then Dwb = "B.xls"
If K = 1206 Then Dwb = "C.xls"
Set Wb = Nothing
'Nothing ÃöÁä¦r¬O¥Î¨Ó±N¤@Óª«¥óÅܼƱq¤@Ó¹ê»Úªºª«¥óùؤÀÂ÷¶}¨Ó¡C¨Ï¥Î Set ³¯z¦¡¥i«ü©w Nothing µ¹ª«¥óÅܼÆ
For Each W In Workbooks
If W.Name = Dwb Then Set Wb = Workbooks(Dwb): Exit For 'Àɮצs¦b ³]©wÅܼÆ
Next '
If Wb Is Nothing Then Set Wb = Workbooks.Open(ThisWorkbook.Path & "\" & Dwb) 'Àɮפ£¦s¦b ³]©wÅܼÆ
xi = Application.CountA(Wb.Sheets(1).Range("A:A")) + 1
Ay = Application.Transpose(Application.Transpose(D(K)))
Wb.Sheets(1).Cells(xi, "A").Resize(UBound(Ay, 1), UBound(Ay, 2)) = Ay
Wb.Close True 'Ãö³¬ÀÉ®×: ¦sÀÉ
Next
End Sub
½Æ»s¥N½X
PS ½Ð«ö¦^ÂÐÁä ,½×¾Â·|³qª¾§Ú¦³¦^ÂЪº©«¤l
§@ªÌ:
p6703
®É¶¡:
2012-7-12 23:34
·PÁÂGBKEEª©¥D¥¨¶°¤w²Å¦X¤p§Ìªº»Ý¨D¡A¥ý¬ã¨s¬Ý¬Ý¡A¦³°ÝÃD¦A½Ð±Ð¤F¡A¦A¦¸·PÁÂ^^
§@ªÌ:
p6703
®É¶¡:
2012-7-16 10:22
GBKEEª©¥D³o´X¤é¨Ï¥Î¦³´X°ÝÃD¦A½Ð±Ð¡A¤´¦A³Â·Ð¤F¡A¥ý¦b¦¹·qÁ¡G
1.¤p§Ì±Nìq³æ¸ê®ÆCOPY¨ì§OÀÉ®×°õ¦æ¡A«oµLªk±N¸ê®ÆCOPY¨ìq³æ³øªí¤¤¡]¦ý¤u§@ªí¦WºÙ§¡¬°SHEET1¡^¡A¥u¯à¦b즳¥¨¶°ªºÀɮפ¤°õ¦æ¤~·|°Ê§@???
2.·s³øªí¤¤ªºCÄæ§Æ±æ¥i®M¨ú·í¤Ñ¤é´Á¡AG¤ÎJÄæ¦ìì³Ì«á¤@Äæ¤w¦³®M¨ú¤½¦¡¡A¦p¦ó±N·s¸ê®Æ©µ¥Î줽¦¡
3.©µ¦ù¥t¤@°ÝÃD¡A¦p¶È¥u¬O¾ã¦C½Æ»s¡A쥨¶°¦p¦óקï???¥i«öìn¨D¦Û°ÊCOPY¨ì«ü©wªº¤u§@ªí¤¤¡]ì¤u§@ªí§¡¤w¦³¸ê®Æ¡A¦Û°Ê©¹³Ì«á¤@¦C¶}©l¥[¤W¸Ó·s¼W¸ê®Æ¡^
§@ªÌ:
p6703
®É¶¡:
2012-7-19 18:08
ÁÙ½ÐGBKEEª©¥DÀ°¦£¬O§_¥i¹F¦¨¤p§Ì»Ý¨Dªº¥\¯à,¥H«K®M¨ú®É§ó¤è«K,ÁÂÁÂ...^^
§@ªÌ:
p6703
®É¶¡:
2012-9-25 17:05
¦Ñ°ÝÃD¤@ª½¥¼¸Ñ¨M¡A¦A¦¸¸ß°Ý°ª¤â¸Ñ´b
GBKEEª©¥D³]pªº¥¨¶°¥i¨Ì¦U±ø¥ó±N¸ê®ÆCOPYªº¦UÀɮתºÄæ¦ì¤¤¡A¦ý¦]¸Ó³øªí¤¤¤@¨ÇÄæ¦ì³£¤w¦³³]©w¤½¦¡¦Û°Ê®M¨ú¼Æ¾Ú¡A¤p§Ì¬O¥H¤Uµ{¦¡½X¥h®M¨úì¹w³]ªº¤½¦¡¡A¦ý¨ä¤¤¦³¤@ÓÀÉ®×®M¨ú¦C¼Æ·|¶W¹L«Ü¦h¦C¡]¨Ò¡Gì·s¸ê®Æ¼W¥[5¦C¡Aµ²ªG°õ¦æ¦¹¥¨¶°«á¨ä¼W¥[¤F´X¦Ê¦C¡^¡A½Ð°Ý¬O§_¦¹¥¨¶°¥i¦Aקï®M¨ú·s¼W¥[ªº¦C¼Æ´N¦n¡AÁÂÁÂ...^^
Range("G2").Select
Selection.End(xlDown).Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:A" & [H2].End(xlDown).Row)
Range("A1:A" & [H2].End(xlDown).Row).Select
§@ªÌ:
Hsieh
®É¶¡:
2012-9-25 20:11
¦^´_
8#
p6703
Sub Ex()
Dim Ws(), A As Range, B As Range, s%, bs$, w As Window
For Each w In Windows
ReDim Preserve Ws(s)
Ws(s) = w.Caption
s = s + 1
Next
With ThisWorkbook.Sheets(1)
For Each A In .Range(.[M2], .[M2].End(xlDown))
bs = IIf(A = 1202, "A.xls", IIf(A = 1205, "B.xls", IIf(A = 1206, "C.xls", "")))
If IsError(Application.Match(bs, Ws, 0)) Then Workbooks.Open ThisWorkbook.Path & "\" & bs: ReDim Preserve Ws(s): Ws(s) = bs: s = s + 1
With Workbooks(bs)
Set B = .Sheets(1).[A65536].End(xlUp).Offset(1)
ar = Array(A.Offset(, -10).Value, IIf(A.Offset(, -12) = "IS" Or A.Offset(, -12) = "IN", 2, ""), Date, A.Offset(, -7).Value, A.Offset(, -3).Value, A.Offset(, -11).Value, B.Offset(, 6).FormulaLocal, A.Offset(, -9).Value, A.Offset(, -8).Value, B.Offset(, 9).FormulaLocal, A.Offset(, -5).Value)
B.Resize(, 11).Value = ar
End With
Next
End With
End Sub
½Æ»s¥N½X
§@ªÌ:
p6703
®É¶¡:
2012-9-26 08:46
·PÁÂHsieh ª©¥D¡A¤p§Ì¦³¤@°ÝÃD¦A½Ð°Ý¡A¦pªG©óA~C³øªíì©T©wÄæ¦ì§Y¦³¤½¦¡¡A¦p¦ó¦b±N·s¸ê®ÆCOPY¨ì³øªí®É¡A±N¦UÄæ¦ìªº¤½¦¡ª½±µ©µ¦ù®M¥Î????
q³æ³øªí¤¤¦³¤½¦¡ªºÄæ¦ì¡GG¡BJ¡BN¡BP¡BR¡BS¡BW
ªþ¥ó¤¤ªºAÀɮצ³¹w³]¤½¦¡...
[attach]12608[/attach]
§@ªÌ:
Hsieh
®É¶¡:
2012-9-26 15:02
¦^´_
10#
p6703
ar = Array(A.Offset(, -10).Value, IIf(A.Offset(, -12) = "IS" Or A.Offset(, -12) = "IN", 2, ""), Date, A.Offset(, -7).Value, A.Offset(, -3).Value, A.Offset(, -11).Value, B.Offset(-1, 6).FormulaR1C1, A.Offset(, -9).Value, A.Offset(, -8).Value, B.Offset(-1, 9).FormulaR1C1, A.Offset(, -5).Value)
§@ªÌ:
p6703
®É¶¡:
2012-9-26 17:31
·PÁÂHsieh ª©¥D¡A¦]¤p§Ììq³æ¸ê®Æ¤¤°£¤FG¤ÎJÄæ¦ì¦³¤½¦¡¥~¡A©|¦³¤½¦¡ªºÄæ¦ìÁÙ¦³N,P,R,S,WÄæ¦ì¡]Äæ¦ì¶¶§Ç¼Æ¬°14,16,18,19,23¡^¡A¤p§Ì¨Ì¼Ëµe¸¬Äª³]©w¤½¦¡¦p¤U¡A«oµLªk©µ¦ù®M¨ú¤½¦¡¡A½Ð°Ý¨º¸Ì¦³¿ù©O????
Ar = Array(A.Offset(, -10).Value, IIf(A.Offset(, -12) = "IS" Or A.Offset(, -12) = "IN", 2, ""), Date, A.Offset(, -7).Value, A.Offset(, -3).Value, A.Offset(, -11).Value, B.Offset(-1, 6).FormulaR1C1, A.Offset(, -9).Value, A.Offset(, -8).Value, B.Offset(-1, 9).FormulaR1C1, A.Offset(, -5).Value
, , , B.Offset(-1, 13).FormulaR1C1, , B.Offset(-1, 15).FormulaR1C1, , B.Offset(-1, 17).FormulaR1C1, B.Offset(-1, 18).FormulaR1C1, , , , B.Offset(-1, 22).FormulaR1C1
)
§@ªÌ:
Hsieh
®É¶¡:
2012-9-26 22:37
¦^´_
12#
p6703
À³¸Ó¬O¼g¤JªºÄæ¼Æ¤£°÷§a
B.Resize(,
11
).Value = ar
קï¬õ¦rªºÄæ¦ì¼Æ¶q¸Õ¸Õ
¦A¤£¦æ½Ð§âÀɮפW¶Ç
§@ªÌ:
p6703
®É¶¡:
2012-9-26 23:07
Hsiehª©¥DB.Resize(, 11).Value = ar³o¸Ì¬O«üÁ`Äæ¼Æ¶Ü??¦]¬°ì¸ê®Æ¦³¨Ç¬O¤â°Ê¿é¤Jªº¡A¦³¨Ç¬O§Æ±æÂǵۥ¨¶°¦Û°Ê¿é¤J¡A¦³¨Ç«h¬O¥Î¤½¦¡®M¨úªº¡A¦pªG³o¸Ì¬O«üÁ`Äæ¦ì¼Æ¡A¦]Àɮשñ¦b¤½¥q¡A©ú¤Ñ¸Õ¬Ý¬Ý^^..ÁÂÁ§A
§@ªÌ:
p6703
®É¶¡:
2012-9-27 09:12
ÁÂÁÂHsiehª©¥D¡A¤p§Ì±NÄæ¼Æ¥Ñì11§ï23´N³£¥i±N줽¦¡©µ¦ù®M¥Î¤F¡A¥¨¶°¯uªº¤Ó¤è«K¡A·PÁÂHsiehª©¥Dªº±Ð¾É¡AÁÂÁÂ^^
§@ªÌ:
p6703
®É¶¡:
2012-9-27 09:45
Hsiehª©¥D¡A¤p§Ì°õ¦æ¤Wµo²{¦³°ÝÃD¡G
¦]¹w³]±N1202-->AÀÉ¡A1205-->BÀÉ¡A1206-->CÀÉ¡A¦ý¨ä¹êÁÙ¦³¨ä¥Lªº¥N½X¡]¨Ò¡G1101¡A¦ý¦¹¼È¤£»Ý®»¤Jq³æ¸ê®Æ¡^¡Aµ²ªG°õ¦æ¥¨¶°®É´N©ó¦¹µ{¦¡½X¤¤°±¦í¡A¨q¥X¿ù»~°T®§¡A½Ð°Ý¬O§_¦³¸Ñªk¤èªk¡AÁÂÁÂ??
If IsError(Application.Match(bs, Ws, 0)) Then Workbooks.Open ThisWorkbook.Path & "\" & bs: ReDim Preserve Ws(s): Ws(s) = bs: s = s + 1
§@ªÌ:
p6703
®É¶¡:
2012-10-1 14:39
¤p§Ì±N«Dì³]©w3p¹ºûªº¸ê®Æ§R°£¡A¦¹¥¨¶°°õ¦æ¤W´N¨S°ÝÃD¤F¡A¦A¦¸·PÁÂHsiehª©¥D
Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)