Sub ProductImportList()
Dim intUnit As Integer
Dim lngRow As Long
Dim strFileName As String
Dim Txt1 As String, Txt2 As String, Txt3 As String, Txt4 As String, Txt5 As String
Dim Txt6 As String, Txt7 As String, Txt8 As String, Txt9 As String, Txt10 As String
Dim Txt11 As String, Txt12 As String, Txt13 As String, Txt14 As String, Txt15 As String
Dim FileHeaders As String
strFileName = "C:\Users\James\Desktop\productlist.csv"
intUnit = xlCSV
Open strFileName For Output As intUnit
FileHeaders = "store,websites,attribute_set,type,category_ids,sku,has_options,gift_message_available,image,name,options_container,small_image,thumbnail,url_key,url_path,image_label,thumbnail_label,small_image_label,price,weight,description,short_description,custom_design_from,status,tax_class_id,visibility,enable_googlecheckout,qty,min_qty,use_config_min_qty,is_qty_decimal,backorders,use_config_backorders,min_sale_qty,use_config_min_sale_qty,max_sale_qty,use_config_max_sale_qty,is_in_stock,low_stock_date,notify_stock_qty,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,stock_status_changed_automatically,product_name,store_id,product_type_id"
Print #intUnit, FileHeaders
lngRow = 6
Do While Len(Cells(lngRow, 1).Value) > 0
If Cells(lngRow, 53).Value = "m" Then
If Cells(lngRow, 50).Value > 0 Then
Txt1 = "admin,base,Default,simple,"
Txt2 = Cells(lngRow, 35).Value & "," & Cells(lngRow, 1).Value & ","
Txt3 = "0,No,"
Txt4 = Cells(lngRow, 57).Value & "," & Cells(lngRow, 6).Value & ","
Txt5 = "Block after Info Column,"
Txt6 = Cells(lngRow, 57).Value & "," & Cells(lngRow, 57).Value & ","
Txt7 = ",,"
Txt8 = Cells(lngRow, 6).Value & "," & Cells(lngRow, 6).Value & "," & Cells(lngRow, 6).Value & "," & Cells(lngRow, 15).Value & "," & Cells(lngRow, 32).Value & "," & Cells(lngRow, 33).Value & "," & Cells(lngRow, 34).Value & ","
Txt9 = ",Enabled,Taxable Goods,"
Txt10 = Cells(lngRow, 36).Value & ","
Txt11 = "No,"
Txt12 = Cells(lngRow, 50).Value & ","
Txt13 = "0,1,0,0,1,1,1,100,1,1,,1,1,1,1,1,"
Txt14 = Cells(lngRow, 6).Value & ","
Txt15 = "0,simple"
Print #intUnit, Txt1 & Txt2 & Txt3 & Txt4 & Txt5 & Txt6 & Txt7 & Txt8 & Txt9 & Txt10 & Txt11 & Txt12 & Txt13 & Txt14 & Txt15
End If
End If
lngRow = lngRow + 1
Loop
Close intUnit
End Sub
Thanks Leith
Bookmarks