Option Explicit
Sub CreaCSV3()
Dim W1 As ThisWorkbook
Dim W2 As Workbook
Dim F1 As Worksheet
Dim F2 As Worksheet
Dim R, X As Long, Files, fpath, fname, uriga, uriga1
Application.ScreenUpdating = False
Set F1 = Sheets("Output_7")
fpath = ThisWorkbook.Path
fname = "Ebay-" & Day(Date) & "-" & Month(Date) & "-" & Year(Date) '& ".csv"
Files = fpath & "" & "Ebay.csv"
Workbooks.Open Filename:=Files
Set F2 = Sheets("Ebay")
uriga = F1.Range("A" & Rows.Count).End(xlUp).Row
uriga1 = F2.Range("A" & Rows.Count).End(xlUp).Row
If uriga1 <> 1 Then
F2.Range(F2.Cells(2, 1), F2.Cells(uriga1, 42)).ClearContents
End If
R = 2
For X = 2 To 5 'uriga
F2.Cells(R, 1) = "Add"
F2.Cells(R, 2) = F1.Cells(R, 8)
If Len(F1.Cells(R, 2)) > 80 Then
F2.Cells(R, 3) = Left(F1.Cells(R, 2), 80)
Else
F2.Cells(R, 3) = F1.Cells(R, 2)
End If
F2.Cells(R, 4) = F1.Cells(R, 3)
F2.Cells(R, 5) = "1000"
F2.Cells(R, 6) = F1.Cells(R, 19)
F2.Cells(R, 7) = F1.Cells(R, 14)
F2.Cells(R, 8) = "FixedPriceItem"
F2.Cells(R, 9) = F1.Cells(R, 9) + (F1.Cells(R, 9) * 21) / 100
F2.Cells(R, 10) = "GTC"
F2.Cells(R, 11) = "20123"
F2.Cells(R, 12) = "1"
F2.Cells(R, 13) = "post-vendita@ipsoware.com"
F2.Cells(R, 14) = "3"
F2.Cells(R, 15) = "ReturnsAccepted"
F2.Cells(R, 17) = "IT_ExpressCourier"
F2.Cells(R, 18) = "8"
F2.Cells(R, 19) = "1"
F2.Cells(R, 20) = "1"
F2.Cells(R, 21) = "0"
F2.Cells(R, 22) = "0"
F2.Cells(R, 23) = "0"
F2.Cells(R, 24) = "0"
F2.Cells(R, 27) = "21"
F2.Cells(R, 28) = "0"
F2.Cells(R, 29) = "1"
F2.Cells(R, 30) = "1"
F2.Cells(R, 31) = "1"
F2.Cells(R, 32) = "0"
F2.Cells(R, 33) = "Flat"
F2.Cells(R, 34) = "-1"
F2.Cells(R, 35) = "0"
F2.Cells(R, 37) = "1|178397022|"
F2.Cells(R, 38) = "0|178397022|"
F2.Cells(R, 39) = "1"
F2.Cells(R, 40) = "0"
F2.Cells(R, 41) = "0"
R = R + 1
Next X
'ActiveWorkbook.Save 'As 'Filename:=fpath & "" & fname, FileFormat:=xlCSV, CreateBackup:=False
'ActiveWindow.Close
Application.ScreenUpdating = True
Set F1 = Nothing
Set F2 = Nothing
MsgBox ("Salvare il files Ebay.csv MANUALMENTE")
End Sub
|