ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý~¦p¦ó±qACCESS§ì¨ú¸ê®Æ¦ÜEXCEL¤u§@ªí¦X¨Ö«á¡A¦A¶×¤JACCESS¸ê®Æ®w

[µo°Ý] ½Ð°Ý~¦p¦ó±qACCESS§ì¨ú¸ê®Æ¦ÜEXCEL¤u§@ªí¦X¨Ö«á¡A¦A¶×¤JACCESS¸ê®Æ®w

¥»©«³Ì«á¥Ñ fusayloveme ©ó 2012-3-26 08:54 ½s¿è

¦U¦ì¤j¤j±z¦n¡A
¤p§Ì¥Ø«e¦³¨Ç°ÝÃD¡A·Q½Ð±Ð¤j®a¡A´N¬O»¡~­Y§Ú·Q±qA¸ê®Æªí¤º(6­ÓÄæ¦ì)§ì¨ú¸ê®Æ¦ÜEXCEL¡A¦ý¥L·|¶}°_¤»­Ó¤u§@ªí¡A§Ú¦p¦ó±N¥L­Ì¦P®É©ñ¸m©ó¤@­Ó¤u§@ªí
µM«á¥u¬OSHEET¤£¦P¡A¦ýSHEET¦WºÙ¶·¨Ì·Ó¨º6­ÓÄæ¦ì¦WºÙ©O!? ¥H¤U§Ú¤w¦³¥ý¹Á¸Õ¼g¥X¤@¬q»yªk¡A§Ú¬O¥ý¥H¶}±Ò¨â­Ó¸ê®Æªí¡AµM«á¥Î¿ý»sªº¤âªk¡A¦A­×§ï¤@¨Ç¡A
­Y¶Ë²´¡A©êºp¤F.... ><"
  1. Sub ¶}±Ò¸ê®Æªí()
  2. Dim mypath, myfile, mydata, X
  3. mypath = ThisWorkbook.Path
  4. myfile = "½d¨Ò¸ê®Æªí_ºô¸ô.accdb"
  5.     ChDir mypath
  6.     For i = 1 To 2
  7.     X = "tb_23_HM" & i
  8.         Workbooks.OpenDatabase Filename:=mypath & "\" & myfile, _
  9.     CommandText:=Array(X), CommandType:=xlCmdTable, ImportDataAs:=xlTable
  10.     Sheets("½d¨Ò¸ê®Æªí_ºô¸ô").Select
  11.     Sheets("½d¨Ò¸ê®Æªí_ºô¸ô").Name = X
  12.     Next
  13.    Windows("Book2").Activate
  14.     Sheets("tb_23_HM2").Select
  15.     Sheets("tb_23_HM2").Move After:=Workbooks("Book1").Sheets(1)
  16.     End Sub
½Æ»s¥N½X
±µ¤U¨Ó³oÃä§Ú´N¥d¦í¤F¡A´N¬O©O~±NB¸ê®Æªí¤ºªº¤»­ÓÄæ¦ìªº¸ê®Æ¡A¦P¼Ë§ì¦ÜEXCEL»PA¸ê®Æªí¤ºªº¸ê®Æ¦X¨Ö¡A¨Ò¦p~A¸ê®Æªí¤ºªº[tb_23_HM1]¦³5µ§¸ê®Æ¶K¦ÜEXCEL¡A¨º§ÚB¸ê®Æªí¤ºªº[tb_23_HM1]¡A´N¬O±q²Ä6µ§¸ê®Æ¶}©l¶K¤W¡C³Ì«á´N¬O±N§t¦³AB¸ê®ÆªíªºEXCEL¶×¤JACCESS¤¤(·s¶}¤@­ÓACCESS¸ê®Æ®w¡A¥i¯à¸û¬°«ê·í)¡C
³Ì«á¡A«Ü©êºp¤@³s¦ê°Ý¤F¨º»ò¦h°ÝÃD¡A¥ýÁÂÁ¤j®aÀ°¦£«ä¦Ò¸Ñ¨M°ÝÃD¡A¹w¯¬¤ß·Q¨Æ¦¨¡C ^_^
Á`µ²¤@¤U°ÝÃD¡G
1.±qACCESS¶}±Ò6­Ó¸ê®Æªí(tb_23_HM1~tb_23_HM6)¡A¬Ý¯à¤£¯à°÷¦b¦P¤@­ÓEXCEL¤º¶}±Ò??
2.¶}±Ò¸ê®Æªí«áªºsheet¡A¬O§_¯à°÷¨Ì·Ó¸ê®Æªí¦WºÙ©R¦W(tb_23_HM1~tb_23_HM6)©O??
3.¦A±NB¸ê®Æªí(tb_23_HM1~tb_23_HM6)¡A¶×¤J­è­è¶}±Òªº¨º­ÓEXCEL¡A¨Ã¤À§O¨Ì·Ósheet¤ÀÃþ¶×¤J¡A¦ý¬OÄÝ©ó±µÄò¤U¨Óªº¡A
   ¨Ò¦pa¸ê®Æ®wªºtb_23_HM1¶×¤J¦Üexcel¬O¨ì²Ä5µ§¡A±µ¤U¨Ób¸ê®Æ®wªºtb_23_HM1¡A¬O§_¥i±q²Ä6µ§¶}©l¶×¤J©O??
4.³Ì«á±N¾ã²z¦nªºexcel¸ê®Æ¡A¦b¨Ì·Ó¤£¦Pªºsheet¡A¶×¤J·sªºaccess¸ê®Æ®w¤º¡C
¦]¬°¤j·§¦³5~60­Ó¸ê®Æªí¶·­n§@¤@­Ó¦X¨Ö¾ã²zªº°Ê§@...¨þ¨þ..¥ýÁÂÁ¤j®a¡C

¤U¸üª«¥ó¤º¦³~½d¨Ò¸ê®Æªí_ºô¸ô¬°A¸ê®Æªí¡A½d¨Ò¸ê®Æªí_®Ñ­±¬°B¸ê®Æªí¡AEXCEL¤º§t§Ú©Ò¼gªºVBA¡AÁÂÁ¤j®a¡C

½d¨Ò¸ê®Æªí.rar (387.61 KB)

        ÀR«ä¦Û¦b : ¨ü¤HÂI¤ô¤§®¦¡A¶··í´é¬u¥H³ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD