Dim xlSheet As Object
Set xlSheet = CreateObject("Excel.Sheet.8")
Dim X As Long, Y As Long
Y = 1
X = 1
xlSheet.worksheets(1).Cells(1, 1).Value = "成交条款"
xlSheet.worksheets(1).Cells(1, 2).Value = "数量"
xlSheet.worksheets(1).Cells(1, 3).Value = "货代"
xlSheet.worksheets(1).Cells(1, 4).Value = "数量"
xlSheet.worksheets(1).Cells(1, 5).Value = "报关行"
xlSheet.worksheets(1).Cells(1, 6).Value = "数量"
xlSheet.worksheets(1).Cells(1, 7).Value = "供应商"
xlSheet.worksheets(1).Cells(1, 8).Value = "数量"
xlSheet.worksheets(1).Cells(1, 9).Value = "记费重量TOTAL"
For Y = 1 To Me.listView1.ListItems.Count
xlSheet.worksheets(1).Cells(Y + 1, 1).Value = Me.listView1.ListItems(Y).Text
xlSheet.worksheets(1).Cells(Y + 1, 2).Value = Me.listView1.ListItems(Y).SubItems(1)
xlSheet.worksheets(1).Cells(Y + 1, 3).Value = Me.listView1.ListItems(Y).SubItems(2)
xlSheet.worksheets(1).Cells(Y + 1, 4).Value = Me.listView1.ListItems(Y).SubItems(3)
xlSheet.worksheets(1).Cells(Y + 1, 5).Value = Me.listView1.ListItems(Y).SubItems(4)
xlSheet.worksheets(1).Cells(Y + 1, 6).Value = Me.listView1.ListItems(Y).SubItems(5)
xlSheet.worksheets(1).Cells(Y + 1, 7).Value = Me.listView1.ListItems(Y).SubItems(6)
xlSheet.worksheets(1).Cells(Y + 1, 8).Value = Me.listView1.ListItems(Y).SubItems(7)
xlSheet.worksheets(1).Cells(Y + 1, 9).Value = Me.listView1.ListItems(Y).SubItems(8)
Next Y
xlSheet.saveas [CurrentProject].[Path] & "\" & Format(Date, "mm.dd") & "发票汇总信息.xls"
xlSheet.Application.Quit
MsgBox "导出成功!!!!"[em07][em07][em07][em07][em07][em07]
[此贴子已经被作者于2004-12-20 16:20:39编辑过]
|