- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2016-3-25 00:38 ½s¿è
¦^´_ 1# maggie1313
¤@¯ëY¹J¨ì "¦³¤@Ó¦@¦PªºKEY È(¤£·|«ÂÐ)" ³oÃþªº»Ý¨D,
§Ú·|Àu¥ý¨Ï¥Î Directory ¨ç¼Æ¨Ó¹ê²{.
¦]¬°§A¨S´£¨Ñ½d¨ÒExcelÀÉ®×,
©Ò¥H§Ú¥t¥~°µ¤@Ó,
§A¥i¥H°Ñ·Óקï¹ê²{§Aªº»Ý¨D.
- Private Sub cbMerge_Click()
- Dim lRow&
- Dim sStr$
- Dim vD1, vD2
-
- Set vD1 = CreateObject("Scripting.Dictionary")
- Set vD2 = CreateObject("Scripting.Dictionary")
-
- Sheets("¦X¨Ö").Range([B2], [C100]).Clear
-
- With Sheets("¯Á¤Þ¤@")
- lRow = 2
- While .Cells(lRow, 1) <> ""
- vD1(CStr(.Cells(lRow, 1))) = .Cells(lRow, 2)
- lRow = lRow + 1
- Wend
- End With
-
- With Sheets("¯Á¤Þ¤G")
- lRow = 2
- While .Cells(lRow, 1) <> ""
- vD2(CStr(.Cells(lRow, 1))) = .Cells(lRow, 2)
- lRow = lRow + 1
- Wend
- End With
- With Sheets("¦X¨Ö")
- lRow = 2
- While .Cells(lRow, 1) <> ""
- sStr = .Cells(lRow, 1)
- .Cells(lRow, 2) = vD1(sStr)
- .Cells(lRow, 3) = vD2(sStr)
- lRow = lRow + 1
- Wend
- End With
- End Sub
½Æ»s¥N½X
Dictionary¹ê°µ.zip (10.02 KB)
¸É¥R:
¦pªG»Ýn¥Î¨ì¾ã¦C¤¤¤£¥u¤@Ä檺¸ê®Æ,
¥i¥H¯Á¤Þ ¦C¸¹:
vD1(CStr(.Cells(lRow, 1))) = lRow
¦A¥Î
Sheets("¦X¨Ö").Cells(lRow, 2) = Sheets("¯Á¤Þ¤@").Cells(vD1(sStr), Ä渹)
¨Ó¨ú±o·Qnªº¸ê®Æ.
¥t¥~,«Øij¤j®a¶}ÃD¤å¤¤¾¨¶q¯à¤@¨Ö´£¨Ñ¤w¸g¥´¦n½d¨Ò¸ê®ÆªºExcelÀÉ®×,
³o¼Ë¦^¤åªº¤H¤~¤£¥ÎÁÙn¦Û¤v¨Ì·Ó¹Ï¤ù¤º®e¤@Ó¤@Ó¿é¤J¸ê®Æ«ØExcelÀÉ®×,
¥i¥H§â®É¶¡±Mª`¦b¦p¦ó¹ê²{§Aªº»Ý¨D¤W. |
|