如果你的excel表已经是如此规范,直接引用就好了
dim dt as datatable = datatables(“表名”)
dim book as xls.book("文件名")
dim sheet as xls.sheet = book.sheet(0)
‘你已知(1,2)是列名,直接从(2,2)开始引用就好了
for i as integer = 2 to 100 ’结尾自己改
if sheet(i,2)value <> "" then
dim dr as datarow = dt.addnew
dr("姓名") = sheet(i,2).value
dr("列名") = sheet(i,?).value ‘要引用其他列的值
。。。。。
endif
next
dt.save