太感謝了,真的可以了耶!
可是我加了where 以後又不行了。主要是想將itm_no這個欄位不為空的才copy到Cells(1, 1).
會出現 error "參數太少,預期個數1"
Sub get_data_with_sql()
Set rs = CreateObject("adodb.recordset")
rs.Open "select * from [大大1217標籤$L2:V39] where itm_no is not null", "Driver={Microsoft Excel Driver (*.xls)};dbq=C:\Users\dsc\Documents\大大高中1217.xls"
Cells(1, 1).CopyFromRecordset (rs)
End Sub