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

ysp128 2003-04-08 08:16:21
怎么样一个字段一个字段地取Excel中的数据
因为我要对字段进行处理才能导入数据库呀
...全文
38 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
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

1,217

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧