¤£¦n·N«ä ·s¤â¤S¨Ó½Ð±Ð ¸ê®Æ¤ñ¹ï°ÝÃD ³Â·Ð¦U¦ì¤F
- ©«¤l
- 26
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 33
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-7-19
- ³Ì«áµn¿ý
- 2013-5-13
|
vba ¤ñ¹ï¸ê®Æ°ÝÃD
¤£¦n·N«ä ¤p§Ì³o°ÝÃD¤w¸g§xÂZ«Ü¤[ ¹ê¦b·Q¤£¥X¨Ó ©Ò¥H¤W¨Ó¨D±Ï ,ÁÂÁ¤j®a¼·®É¶¡À°§Ú¬Ý
¦³¨âÓexcelÀÉ,¦pªþ¥ó
book1¸Ì±ªºc sheet ¬O§Ú·Qn«Ø¥ß¤@Óbuttonªº¦a¤è,«ö¤U¥h¤§«á¯à°÷°µ¥H¤U°Ê§@
¥Øªº¬O§Æ±æ¯à°÷§âbook2 (b sheet) ¸Ì±ªº¸ê®Æ §ì¨ìbook1ªº (a sheet ),
¤]´N¬O§âÃC¦â¼Ð¥X¨Óªº¦a¤èbook2.b.sheet,COPY¨ìbook1.a.sheet
ªþÀɪºÃC¦â¬O§Ú«á¨Ó¥[¤W¥hªº,¥u¬O¬°¤F¤è«K´yz ,
part_id ¶ñ§¹¤F©¹¥kÃäÀx¦s®æshift¤@¦ì ¨Ì¦¹Ãþ±À,
ope_no¥u»Ý§ì«á¤T½X «e«á»Ýn©T©w¥Î(),¥Î,¸¹¹j¶},¨CӼƦr³£n¦³ ' '
¤º®e¤w¸g²¤Æ,¹ê»Ú¤Wªºtable¸ê®ÆÆZ¦h,¤£³æ¥u¬O¨âµ§, §Ú»{¬°n¥Îfor°j°é ¦ýÁÙ«Ü¹à ¤£¤Ó¼ô ½Ð±Ð¦U¦ì¤F
¥H¤W ·P¿E¤£ºÉ
question.rar (4.6 KB)
|
|
|
|
|
|
|
- ©«¤l
- 26
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 33
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-7-19
- ³Ì«áµn¿ý
- 2013-5-13
|
½Ð°ÝªO¤j ¤£¦n·N«ä ¦A½Ð±Ð¤@Ó°ÝÃD ³o¼Ëªº»Ý¨D§Ú¥i¥H°Ñ¦Ò®ÑÄy¤¤ªºþ¨Çfunction ? ÁÂÁ |
|
|
|
|
|
|
- ©«¤l
- 26
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 33
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-7-19
- ³Ì«áµn¿ý
- 2013-5-13
|
ªO¤j§A¦n~adef ¥u¬O§Ú°²³]¦³¨ä¥LªºÄæ¦ì¤w¸g¦bbook1¸Ì±,¦bbook1¤¤¥Dn¬O¥h¬Ýope_no ¸òpart_id ³o¨âÓÀx¦s®æ¥k¤âÃ䪺¸ê®Æ(parit-id---->12345, ope_no ---> 333 444 555 777),³o¨Ç¸ê®Æ¬O±qbook2¸Ì±ªºb sheet¨Óªº,¥u¬O¦bbook2 copy¹L¨Ó¤§«á ¦bbook1n°µ¤@¨Çקï ,ope_no ´N¬OnÅܬ° ('333','444','555','777')¥[¤W¬A©·,³r¸¹©M¤À¸¹
partid «h¬O¦pªG¦bbook2¸Ì±¦³¤@Ó¥H¤Wªºpart_id¥X²{®É ,¦b¶ñ¤Jbook1ªº®É«á,nÅܦ¨ part id 12345 5678 (5678n¶ñ¦b12345®ÇÃ䨺ÓÀx¦s®æ)
¤£ª¾¹D³o¼Ë¦³²M·¡¶Ü? ÁÂÁ§A §Ú¤]·|¦Û¤v¦b¸ÕµÛ¼g~ |
|
|
|
|
|
|
- ©«¤l
- 26
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 33
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-7-19
- ³Ì«áµn¿ý
- 2013-5-13
|
@¶W¯Åª©¥D ÁÂÁ§A §Ú¦b¬ã¨s¤@¤U§Aªº¼gªk
@ª©¥D ©êºp §Ú¦b´yz²M·¡¤@ÂI ÁÂÁ |
|
|
|
|
|
|
- ©«¤l
- 26
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 33
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-7-19
- ³Ì«áµn¿ý
- 2013-5-13
|
ÁÂÁ¨â¦ìª©¥D, code§Ú¤w¸g¬Ý§¹¤F¤]¬ÝÀ´¤F,¤]¦Û¤v¸ÕµÛ°µ¤F¤@¨Ç×§ï «D±`·PÁÂ
¦³¨âÓ°ÝÃD·Q½Ð±Ð
²Ä¤@Ó°ÝÃD´N¬O ¥H¤U³o¬qcode¬°¤°»ò¨S¦³¹ïÀ³ªºend if? ¬O¤£»Ýn¶Ü?
If a = "part_id" Then mystr = a.Offset(, 1).Text
²Ä¤GÓ°ÝÃD¬O
³oÓcode¥Dn¬O§âpart_id ¥i¥H¸ò ope_no¥h°µ¹ïÀ³ ,¦p¤Uªí¥Ü
part_id y z
('356','456') ('556')
¦pªG§Ú·Q§ï¦¨
part_id y z
('356','456','556')
À³¸Ó¬Oקï¥H¤U³o¤@¬qcode,¸Õ¤F¤@¤U¤È,¥i§_¦A±Ð§Ú¤@¤U ·P¿E¤£ºÉ
If d(mystr) = "" Then
d(mystr) = "'" & Right(a.Offset(, 1), 3) & "'"
Else
d(mystr) = d(mystr) & ",'" & Right(a.Offset(, 1), 3) & "'"
End If |
|
|
|
|
|
|
- ©«¤l
- 26
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 33
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-7-19
- ³Ì«áµn¿ý
- 2013-5-13
|
ÁÂÁª©¥D§A¼ö¤ßªº¦^ÂÐ ¯uªº«Ü·PÁÂ
¦³°ÝÃD·Q½Ð±Ð ¤W±³o¦Ucodeªºmystr ¤£¥Î©w¸q¹À?? ¤£¥Î¥Î¨ìDictionary¤F?³o¼Ë¼g¬O©w¸qmystr¬O¯x°}ªº·N«ä¹À?
§ÚÀ³¸Ó¬O¤£¤Àpart id §âope_no¼g¶i¥hÀx¦s®æ¸Ì¨S¿ù
¦ý¬Opart_id ¬On¤ÀÀx¦s®æªº ¦p¤U± y z ³o¼Ë
part_id y z
('356','456','556')
§Ú·|¦n¦n§V¤Oªº ÁÂÁ |
|
|
|
|
|
|