|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 tender888 于 2022-12-19 22:23 编辑
Sub tt()
Dim rng As Range
Dim cString As String
Dim rngRow As Integer
Dim cnn As Object
Dim rs
' Dim arr() Set cnn = CreateObject("ADODB.Connection")
cnn.Open "dsn=excel files;dbq=" & Application.ActiveWorkbook.FullName
Set rs = cnn.Execute("SELECT * from [Temp$] order by 1, 2, 4, 6, 7, 8")
arr = rs.GetRows()
cnn.Close
Set cnn = Nothing
Sheets("Temp").Select
Sheets("Temp").[j1].Resize(UBound(arr, 1), UBound(arr, 2)) = arr'没有错误提示,为什么回填不成功?
Erase arr
End Sub
|
|