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

excel ³s±µ SQL 2008»yªk ¦p¦ó§ï¶i »P°j°é

¦^´_ 2# joey0415
¬d¸ß¤w¸g¦s¦b¤£¦A¨Ï¥ÎAdd
°²³]¥N¸¹¬O2030~2032
´N¦P¤@­Ó¬d¸ß¨Ï¤§ÅܤÆ
  1. Sub ªÑ²¼¸ê®Æ1()
  2. For Each MyID In Array("2030","2031",2032")
  3.     With Sheets("Sheet1").QueryTables(1)
  4.         .CommandText = Array( _
  5.         "select * from (SELECT TOP 12 *  FROM stock.dbo.StockStore WHERE stockid=" & MyID & " ORDER BY sdate DESC) AAA ORDER BY sdate")
  6.         .Name = "¨Ó¦Û "
  7.         .FieldNames = True
  8.         .RowNumbers = False
  9.         .FillAdjacentFormulas = False
  10.         .PreserveFormatting = True
  11.         .RefreshOnFileOpen = False
  12.         .BackgroundQuery = True
  13.         .RefreshStyle = xlInsertDeleteCells
  14.         .SavePassword = True
  15.         .SaveData = True
  16.         .AdjustColumnWidth = True
  17.         .RefreshPeriod = 0
  18.         .PreserveColumnInfo = True
  19.         .Refresh BackgroundQuery:=False
  20.     End With
  21. Next
  22. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

§A¬JµM¤w¸g¿ý»s¥X¨Ó
¥i¨£§A±o¬d¸ß¤w¸g«Ø¥ß
©Ò¥H±b¸¹±K½XÀ³¸Ó³£³Q°O¿ý
§A¥ý®M¥Î¬Ý¬Ý¬O§_¦³¹F¨ìÅܤÆ
¦A°w¹ï¹J¨ìªº°ÝÃDµo°Ý
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD