以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- EXCEL使用 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=184301)
|
-- 作者:kaituozhe
-- 发布时间:2022/12/1 21:57:00
-- EXCEL使用
- Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook =
App.WorkBooks.Open("D:\\Report.xls") Dim Ws As MSExcel.WorkSheet =
Wb.WorkSheets(1) Dim Rg As MSExcel.Range =
Ws.UsedRange MessageBox.Show(Rg.Rows.Count) MessageBox.Show(Rg.Columns.Count) MessageBox.Show(Rg.Count) App.Quit - Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook =
App.WorkBooks.Open("D:\\Report.xls") Dim Ws As MSExcel.WorkSheet =
Wb.WorkSheets(1) Dim Rg As MSExcel.Range = Ws.Range("A2") Rg =
Rg.Offset(5,3) MessageBox.Show(Rg.Address) App.Quit
我想动态引用单元格,怎么表示呀,比如 Ws.Range("A&Rg.Columns.Count") 我知道不对,但是该怎么写呀
|
-- 作者:有点蓝
-- 发布时间:2022/12/1 22:01:00
--
Ws.Range("A" & Rg.Columns.Count)
|