XLSworkbook2.Worksheets(1).Range("a1", "j50000").Value = 数组
一行即可。
第二个办法:把数组内容一次性保存到数据库(ACCESS、或者SQLET数据库等),可以按行插入(较慢),也可以直接保存到一个大数据字段中(快),这两种办法总比直接导出EXCEL快。以后有空再从数据库导出EXCEL。
Dim conn As New ADODB.ConnectionDim rs As New ADODB.Recordset
Dim strsql As String
Dim cnstr As String
conn.CursorLocation = adUseClient
cnstr = "Provider=Microsoft.Jet.OLEDB.4.0Data Source= db1.mdbJet OLEDB:Database Password="
conn.ConnectionString = cnstr
conn.Open cnstr
strsql = "select * from ssq"
rs.Open strsql, conn, 3, 3
For i = 0 To var.Length - 1
rs.addnew
For j = 0 To s.Length - 1
rs(j)=str(i,j)
next
rs.update
next
rs.close
conn.close
'记得引用microsoft activex data objects x.x library
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)