¬Û¦P©m¦W¤§±ø¥ó¤U ³¡¤À¸ê®ÆÂಾ?
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¬Û¦P©m¦W¤§±ø¥ó¤U ³¡¤À¸ê®ÆÂಾ?
½Ð±Ð¤j¤jÌ:
workbook("1").sheets(3)¤¤²Ä¤TÄ欰©m¦W¡Aworkbook("2").sheets(5)¤¤²Ä¤GÄ欰©m¦W¡A
¦b¬Û¦P©m¦W¤§±ø¥ó¤U¡A±Nworkbook("1").sheets(3)¤¤²Ä6,7,9Äæ¸ê®Æ¶ñ¨ìworkbook("2").sheets(5)±µµÛ³Ì«áªÅ¥Õ¤TÄæ¡A
¨D§U©ó¤j¤j ¥i¦³VBA¸Ñ¨M?
ÁÂÁÂ |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¥»©«³Ì«á¥Ñ yangjie ©ó 2012-9-3 17:55 ½s¿è
¦^´_ 2# Hsieh
ÁÂÁÂHsieh¶W¯Åª©¤j
§Ú¥Î¶Ç²Î¤@歩¤@歩¨Ó¥Î¤F50¦h¦æ®ÄªG¤£¦n
¦]¤£·|¥ÎScripting.Dictionary
¥i§_½ç±Ð¥H¤U¤£À´¤§³B
1. Set d = CreateObject("Scripting.Dictionary")
With Workbooks("1.xls").Sheets(3)
For Each A In .Range(.[C2], .[C65536].End(xlUp))
d(A & "") = Array(A.Offset(, 3).Value, A.Offset(, 4).Value, A.Offset(, 6).Value)
next
¨ä¤¤ d(A & "") ¬°¦ón &""
2. With Workbooks("2.xls").Sheets(5)
For Each A In .Range(.[B2], .[B65536].End(xlUp))
A.Offset(, 1).Resize(, 3).Value = d(A & "")
Next
End With
¦ó³B±oª¾¬O§ä¬Û¦P¸ê®Æ±ø¥ó?¬O§_ A ¤§¬G?©Î¬ODictionary¤§¬G?
3. Y¶K¤W¤§³B«D¬Û³s¤§Àx¦s®æ¡A«hA.Offset(, 1).Resize(, 3).Value = d(A & "")
À³¦p¦ó×¥¿?
¤Q¤À·P¿E ¦¬Ã¬»á¦h |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 4# Hsieh
¤Ó´Î¤F §¹¥þ¤F¸Ñ ÁÂÁ ¥H«áÀ³·|µ½¥[§Q¥Î |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 4# Hsieh
ÁÂÁÂHsieh
Y ¶×¥X¤§Äæ¦ì¼Æ ¨C¦¸¬Û²§¤]´N¬OÅܼÆ(¦ý¥i¨ú±oÓ¼Æ)
Set d = CreateObject("Scripting.Dictionary")
With Workbooks("1.xls").Sheets(3)
For Each A In .Range(.[C2], .[C65536].End(xlUp))
d(A & "") = Array(A.Offset(, 3).Value, A.Offset(, 4).Value, A.Offset(, 6).Value)
next
¨ä¤¤ d(A & "") = Array(A.Offset(, 3).Value, A.Offset(, 4).Value, A.Offset(, 6).Value,------)
¦]¬°¥ÎVBA ¨ú±on1(1)=3, n1(2)=4, n1(3)=6, n1(4)=9 ,n1(5)=0,n1(6)=0,0,0,0,0------
¦Ó¥i¯à¤U¤@¦¸VBA ¨ú±on1(1)=5, n1(2)=7, n1(3)=0, n1(4)=0 ,n1(5)=0,n1(6)=0,0,0,0,0------
¬O¬Gd(A & "") = Array(A.Offset(, 3).Value, A.Offset(, 4).Value, A.Offset(, 6).Value)
À³¦p¦ó×¥¿¼g¦¨(¬¡ªº)? |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 7# Hsieh
ÁÂÁÂHsieh
§Úªº·N«ä¬° YVBA ¤w §ì¨ìn1(1)=3,n1(2)=5¨âÓÄæ¦ì¤§column
«h d(A & "")=array(A.Offset(,n1(1)-2).value,A.Offset(,n1(2)-2).value) '¤wcolumns(2)¬°·Ç
YVBA ¤w §ì¨ìn1(1)=3,n1(2)=5,n1(3)=6¤TÓÄæ¦ì¤§column
«h d(A & "")=array(A.Offset(,n1(1)-2).value,A.Offset(,n1(2)-2).value,A.Offset(,n1(3)-2).value)
³o¨â¦¡µ¥µ¥¦p¦ó¼g¦¨¤@¦¡(¤]¥i¯à¬°¥|ÓÄæ¦ì)? |
|
|
|
|
|
|
- ©«¤l
- 258
- ¥DÃD
- 77
- ºëµØ
- 0
- ¿n¤À
- 385
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-8-8
- ³Ì«áµn¿ý
- 2021-1-25
|
¦^´_ 7# Hsieh
°ÝÃD¸Ñ¨M¤F
¦Û¦æ¥[¤Jd1( )
µM«á
ReDim Preserve d1(i - 1)
d1(i - 1) = a.Offset(, n1(i) - default1).Value '¼W¥[items
µ²ªG¶¶§Q
Set d = CreateObject("Scripting.Dictionary")
With Workbooks(str1).Sheets(sh1)
For Each a In .Range(.Cells(2, default1), .Cells(65536, default1).End(xlUp))
Dim d1()
d1 = Array(a.Offset(, n1(1) - default1).Value)
If s1 > 1 Then
For i = 2 To s1
ReDim Preserve d1(i - 1)
d1(i - 1) = a.Offset(, n1(i) - default1).Value
Next
End If
d(a & "") = d1
Next
End With
¨Ñ¤j®a°Ñ¦Ò«ü±Ð
ºî¦X¦h¤Ñ¨Ó ¦b¦U©««ü¾É
ÁÂÁ Kimbal & Hsieh & GBKEE ¤T¦ì¤j¤j |
|
|
|
|
|
|