Function uploadTOaccess_DeliveryStatus()
'**********************************
' upload the "urchase Order Details Report(Delivery Status)"
' 用于将EXCEL表上传Tab_PO
' Macro recorded 2007-1-7 by charlie
' 由于分批入库,PO有重复
' 注意物料名称有?,造成格式不对,需要手工调整
' ado---Microsoft ActiveX Date Objects X.X Library
'**********************************
Dim conn As New ADODB.Connection, connstr As String, db As String, rs As New ADODB.Recordset
Dim rowexcel As Long
Dim lastrow As Long '上传数据的最后一行
Dim k As Long
Dim rs1 As New ADODB.Recordset
Dim strSQL As String
Dim accesspath As String 'access文件的路径
Dim accessfile As String 'access文件名
'如果上传的表不对,则退出
If Cells(2, 2) <> "★★== Purchase Order Details Report(Delivery Status) ==★★" Then
MsgBox "你上传的不对,应该是 PO Delivery Report"
Exit Function
End If
'Find last row最后一行
'Sheets("Offer").Select
For k = 7 To 60000
If ((Cells(k, 3) = "") And (Cells(k, 5) = "") And (Cells(k, 7)) = "") Then
lastrow = k
Exit For
End If
Next k
'对该行清理颜色
Range("C1").Select
Selection.ClearComments
Range("C1").AddComment
Range("C1").Comment.Visible = False
Range("C1").Comment.Text Text:="Marked color cell is updated to Access" & Chr(10) & "" & Chr(10) & ""
Columns("C:C").Select
Selection.Interior.ColorIndex = xlNone