- ©«¤l
- 72
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 90
- ÂI¦W
- 0
- §@·~¨t²Î
- windows xp
- ³nÅ骩¥»
- office 2000
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-2-14
- ³Ì«áµn¿ý
- 2024-10-13
|
ª©¤j: À°¦£¸Ñ´b¤@¤U
§Ún±N¼´¨ú¨ìªº¸ê®Æ±µÄò¤§«eªº¸ê®Æ (¶ñ¤JSheet2) ;°²³]Sheet2¤w¦³300¦æ¸ê®Æ,µ{¦¡±N¼´¨úªº¸ê®Æ,¶ñ¤J²Ä301¦æªº B Äæ¶}©l¶×¤J
1. ²Ä301¦æªº A Äæ¶ñ¤J¬Q¤Ñ¤é´Á (·Ç³Æn¶×¤Jªº¸ê®Æ¦³30µ§,«h A Ä檺¤é´Á(¬Q¤Ñ)n30¦æ)
2. n¦p¦ó±N¸ê®Æ®wªºÄæ¦ì¥h°£,¥un¼´¥Xªº¸ê®Æ
Execl®æ¦¡¦p¤U: (¼´¨ú¸ê®Æ®w¸ê®Æ¶×¤J¤º®e, (²Ä¤@µ§¬O¸ê®Æ®wÄæ¦ì,¤£n¶×¤J, ¥un¼´¥Xªº¸ê®Æ¶×¤J)A Äæ¦Û°Ê¶ñ¤J¬Q¤Ñ¤é´Á ,¸ê®Æ®w¸ê®Æ±q B Äæ¶}©l)
A B C D E F G H
301 8/1 ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e
302 8/1 ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e
303 8/1 ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e ¸ê®Æ¤º®e
sql = sql &"SELECT * FROM ABC "
pp = Application.WorksheetFunction.CountA(Sheet2.Columns(1), 2) '§Ú¥Î³o§PÂ_ Sheet2 ¤w¦³¸ê®Æ´Xµ§, ¥¼¨Ó¼´¨úªº¸ê®Æ±µÄò«á±
With ActiveSheet.QueryTables.Add(Connection:="ODBC;DSN=XXX;UID=XXX;PWD=XXX;MODE=SHARE;DBALIAS=edb;", Destination:=Sheet2.Cells(pp)) |
|