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

¼Ï¯Ã¤ÀªRªí-±Æ§Ç

¦^´_ 8# 198188


       Sub test()
Set cn = CreateObject("adodb.connection"): V = Application.Version
If V >= 12 Then V = "Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties=Excel 12.0;"
If V < 12 Then V = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0;"
cn.Open V & "Data Source=" & ThisWorkbook.FullName
q = "select top 10 " & Sheet1.[A1] & ", [" & Sheet2.[C1] & "] from [" & Sheet1.Name & "$A1:L]"
q = q & " order by [" & Sheet2.[C1] & "] desc"
Sheet2.[C4].CopyFromRecordset cn.Execute(q)
End Sub
Xl0000096.zip (22 Bytes)

TOP

Xl0000096.zip (25.51 KB) ¦^´_ 10# 198188


    ¸É¶Ç

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD