注册 登录
编程论坛 VB6论坛

请问哪位老师有如何将查询数据结果导出到指定的Excel 单元格中代码示例啊

pxinfo 发布于 2020-02-16 00:39, 2097 次点击
请问哪位老师有如何将查询数据结果导出到指定的Excel 单元格中代码示例啊,谢谢了
2 回复
#2
wujingyi2020-02-20 19:51
加我微信 15850109865 我来帮你
#3
show1472020-03-18 13:28
Dim e As New Excel.Application
Set e = New Excel.Application
e.Visible = True
e.Workbooks.Add
 Cells.Select
Selection.Font.Size = 10
 Range("G:G,AB:AB,AC:AC,e:e,r:r,v:v").Select
 Selection.NumberFormatLocal = "@"
 Range("e:e,r:r,v:v").Select
  Selection.ColumnWidth = 18
  Range("g:g,p:p,t:t,x:x,ab:ab,ac:ac").Select
Selection.ColumnWidth = 11
  
  For i = 1 To Msf1.Rows
  For j = 1 To Msf1.Cols
    e.Cells(i, j).Value = Msf1.TextMatrix(i - 1, j - 1)
    Next
Next
e.ActiveSheet.Columns(2).Delete

End Sub

先要引用excel ,怎么引用问度娘
1