以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  数组分开填入不行吗?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=149319)

--  作者:hongye
--  发布时间:2020/4/28 23:02:00
--  数组分开填入不行吗?
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("D:\\Report.xlsx")
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Array As String() = {"a","b","c","d"}   \'定义数组
Dim Rg As MSExcel.Range = Ws.Range("A1,E1,H1,R1")
Rg.Value = Array \'写入指定的单元格
Wb.SaveAs("D:\\Report.xlsx")
App.Visible = True

--  作者:有点蓝
--  发布时间:2020/4/28 23:06:00
--  
零散的单元格还是逐个填写吧