对导出的excel表某列排序,代码如何实现 Post By:2016/12/23 15:07:00 [显示全部帖子]
Dim Book As New XLS.Book '定义一个Excel工作簿
Dim Sheet
As XLS.Sheet = Book.Sheets(0) '引用工作簿的第一个工作表 For c AsInteger = 0To nms.length -1
Sheet(0,
c).Value =
caps(c)'指定列标题 Sheet.Cols(c).Width = szs(c)
'指定列宽 Next For r AsInteger = 0To dt.Rows.Count - 1'填入数据 For c AsInteger =
0To nms.length -1 Sheet(r +1, c).Value = dt.rows(r)(nms(c)) Next Next