|
For i= 1 to nRowAdd
DataTable.Getsheet("add").SetCurrentRow(i)
ClickDep=DataTable.Value("ClickDep","add")
OrgId=DataTable.Value("OrgId","add")
OrgName=DataTable.Value("OrgName","add")
OrgParId=DataTable.Value("OrgParId","add")
IfEnable=DataTable.Value("IfEnable","add")
Ifjc=DataTable.Value("Ifjc","add")
Resumer=DataTable.Value("Resumer","add")
Telephone=DataTable.Value("Telephone","add")
Memo=DataTable.Value("Memo","add")
ExpectedResults=DataTable.Value("ExpectedResults","add")
Next
-------------------------------------
我想写个函数可以将 datatable的列名转化为变量,并将值赋给这个变量,但是不行,应该怎么写啊?
Function InitDataTable(sheetName,nRowAdd,nColumnAdd)
For i= 1 to nRowAdd
For j=1 to nColumnAdd
DataTable.Getsheet(sheetName).SetCurrentRow(i)
ColumnName=DataTable.GetSheet(sheetName).GetParameter(j).Name
Execute ColumnName & "=DataTable.Value(" & """ & ColumnName & """ & "," & """ & sheetName & """ & ")"
Next
Next
End Function |
|