|
Public Sub 同步()
Dim rowCount As Integer, i As Integer
rowCount = Range("c" & Rows.Count).End(xlUp).Row
If rowCount > 4 Then
For i = 5 To rowCount
r_sh = Sheets("售后详情").Range("B" & Sheets(1).Rows.Count).End(xlUp).Row + 1
Sheets("售后详情").Cells(r_sh, "A") = Cells(i, "B") '原单号退回_自动日期
Sheets("售后详情").Cells(r_sh, "B") = Cells(i, "C") '原单号退回_拦截或拒收
Sheets("售后详情").Cells(r_sh, "C") = Cells(i, "D") '原单号退回_状态
Sheets("售后详情").Cells(r_sh, "F") = Cells(i, "G") '退货退款_自动日期
Sheets("售后详情").Cells(r_sh, "G") = Cells(i, "H") '退货退款_订单号
Sheets("售后详情").Cells(r_sh, "H") = Cells(i, "I") '退货退款_退回单号
Sheets("售后详情").Cells(r_sh, "I") = Cells(i, "J") '退货退款_数量
r_th = Sheets("退货入库").Range("B" & Sheets(1).Rows.Count).End(xlUp).Row
Debug.Print r_th
c_th = Sheets("退货入库").Range("b" & r_th).End(xlToRight).Column
If c_th >= 12 Then
c_th = 1
r_th = r_th + 1
End If
Debug.Print r_th, c_th
' Sheets("退货入库").Cells(r_th, c_th) = Cells(i, "M") '退货入库_自动日期
Sheets("退货入库").Cells(r_th, c_th + 1) = Cells(i, "N") '退货入库_退回单号
Range("c" & i & ",d" & i & ",H" & i & ",I" & i & ",J" & i & ",N" & i).ClearContents
Next i
bn = MsgBox("同步成功" & rowCount - 4 & "条记录", vbOKOnly, "消息")
End If
End Sub
|
|