急救!!!急救!!!!!Excel问题呀!!!高分!!给你,不够再加!

ysp128 2003-04-08 08:16:21
怎么样一个字段一个字段地取Excel中的数据
因为我要对字段进行处理才能导入数据库呀
...全文
3 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
s6w6k 2003-04-08
不如先在excel整理数据,然后,再导入!
回复
efei 2003-04-08
引用Excel
Dim excel_app As Object
Dim sheet1 As Object
Dim row As Integer
Dim col As Integer
Set excel_app = CreateObject("Excel.Application")
excel_app.Workbooks.Open FileName:="filename"
Set sheet1 = excel_app.Workbooks(1).Worksheets("sheetname")
sheet1.Cells(row, col)就是相应的单元格数据
回复
JimexLee 2003-04-08
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlsheet As Excel.Worksheet

Set xlApp = New Excel.Application
Set xlBook = GetObject(App.Path + "\book\biao1.xls")
Set xlsheet = xlBook.Sheets(1)

With xlsheet
text1=.range("A1")'A1是单元格的名称
text2=.range("A2")
end with
回复
蘑菇 2003-04-08
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlsheet As Excel.Worksheet

Set xlApp = New Excel.Application
Set xlBook = GetObject(App.Path + "\book\biao1.xls")
Set xlsheet = xlBook.Sheets(1)
用xlsheet对象进行循环读取就行了
回复
sxs69 2003-04-08
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlsheet As Excel.Worksheet

Set xlApp = New Excel.Application
Set xlBook = GetObject(App.Path + "\book\biao1.xls")
Set xlsheet = xlBook.Sheets(1)

With xlsheet
text1=.Cells(1, 1)
text2=.Cells(2, 2)
end with
回复
相关推荐
发帖

1187

社区成员

VB 数据库(包含打印,安装,报表)
申请成为版主
帖子事件
创建了帖子
2003-04-08 08:16
社区公告
暂无公告