|
给你个代码看看,我写的
Set xlapp = CreateObject("Excel.Application")
Set xlapp = New Excel.Application
Set xlbook = xlapp.Workbooks.Add
Set xlsheet = xlbook.Worksheets(1)
xlapp.Application.ScreenUpdating = False
xlapp.Visible = True
xlapp.Application.ActiveSheet.Rows("1:1").Select
xlapp.Application.selection.Insert Shift:=xldown
xlapp.Application.ActiveSheet.Range("A1") = "SHIPPMENT TO USA " & date
xlapp.Worksheets(1).Range("A1").Select
With xlsheet
.Cells(1, 1).ColumnWidth = 3
.Cells(1, 2).ColumnWidth = 10
.Cells(1, 3).ColumnWidth = 15
.Cells(1, 4).ColumnWidth = 10
.Cells(1, 5).ColumnWidth = 10
.Cells(1, 6).ColumnWidth = 10
.Cells(1, 7).ColumnWidth = 5
.Cells(2, 1) = ""
.Cells(2, 2) = "JobLot"
.Cells(2, 3) = "Co-Loader"
.Cells(2, 4) = "P.O.L"
.Cells(2, 5) = "P.O.D"
.Cells(2, 6) = "Vel/Vovage"
.Cells(2, 7) = "ETD"
...............................
end with |
|