码迷,mamicode.com
首页 > Web开发 > 详细

ebay商品基本属性组合成数据表格式,可用上传到系统递交数据

时间:2017-02-24 14:26:45      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:image   exit   count   port   blog   export   second   不能   check   

该刊登表设计是利用VB写的,当时因为两个系统的数据不能直接对接,又copy并且组合SKU,一个表格一个表格填写,比较麻烦,还好刊登系统可以允许用excel表格上传数据

所以就下好模板,学了VB语言,在业余的时候做了这个数据自动组合功能用刊登数据广告。

另外也使用VB写了一个excel表格几千行数据的处理(这个另做解释)

********************************************************************************************************************

关于SKU刊登功能如下:
(图文与代码)从basic表提取数据 判断数据并组装好,填写在export表上面的格式,就可以上传到系统后台的,这样在产品刊登上可以节省很多时间(总共有106列,但最重要的是SKU和属性的组合);

 

技术分享技术分享

关键代码:

Sub E_US刊登模板0420()

        basic表单参数
        
    With Sheets("basic")
    
    basic_cnt = .Range("a63556").End(xlUp).Row
    
    basic_i = 2
    
    export-20130124表格的起始点,用j来递增多属性,完成后返还给i;
    
    i = 3
        
    Do While basic_i <= basic_cnt
        
        
        basic_sku = .Cells(basic_i, "a")
        basic_site = .Cells(basic_i, "b")
        basic_price = .Cells(basic_i, "c")
        basic_ismult = .Cells(basic_i, "d")
        basic_mv1_code = .Cells(basic_i, "e")
        basic_mv1_att = .Cells(basic_i, "f")
        basic_mv1_val = .Cells(basic_i, "g")
        basic_mv2_code = .Cells(basic_i, "h")
        basic_mv2_att = .Cells(basic_i, "i")
        basic_mv2_val = .Cells(basic_i, "j")
        basic_mv3_code = .Cells(basic_i, "k")
        basic_mv3_att = .Cells(basic_i, "l")
        basic_mv3_val = .Cells(basic_i, "m")
        basic_title = .Cells(basic_i, "n")
        basic_description = .Cells(basic_i, "o")
        basic_ebay_cat1 = .Cells(basic_i, "p")
        basic_ebay_cat2 = .Cells(basic_i, "q")
        basic_item_spec4 = .Cells(basic_i, "r")
        basic_item_spec5 = .Cells(basic_i, "s")
        basic_item_spec6 = .Cells(basic_i, "t")
        basic_item_spec7 = .Cells(basic_i, "u")
        basic_item_spec8 = .Cells(basic_i, "v")
        basic_item_spec9 = .Cells(basic_i, "w")
        basic_item_spec10 = .Cells(basic_i, "x")
        basic_item_spec11 = .Cells(basic_i, "y")
        basic_item_spec12 = .Cells(basic_i, "z")
        basic_item_spec13 = .Cells(basic_i, "aa")
        basic_item_spec14 = .Cells(basic_i, "ab")
        basic_item_spec15 = .Cells(basic_i, "ac")
        basic_photo = .Cells(basic_i, "ad")
    
        
        j来引导下一个多属性
        j = i
        
        
        ----------------------------
        数据表列号
        dsheet_row_id = "A"
        dsheet_shop_initial = "B"
        dsheet_sitecode = "C"
        dsheet_currency = "D"
        dsheet_format = "E"
        dsheet_duration = "F"
        dsheet_var_parent_sku = "G"
        dsheet_product_code = "H"
        dsheet_remark = "I"
        dsheet_var_photo = "J"
        dsheet_var_child_var1 = "K"
        dsheet_var_child_var2 = "L"
        dsheet_var_child_var3 = "M"
        dsheet_var_child_var4 = "N"
        dsheet_var_child_var5 = "O"
        dsheet_var_ean = "P"
        dsheet_var_upc = "Q"
        dsheet_var_isbn = "R"
        dsheet_lot_size = "S"
        dsheet_qty = "T"
        dsheet_price = "U"
        dsheet_discount_profileid = "V"
        dsheet_isoffer = "W"
        dsheet_rejectamt = "X"
        dsheet_acceptamt = "Y"
        dsheet_payment_method = "Z"
        dsheet_paypal_email = "AA"
        dsheet_autopay = "AB"
        dsheet_checkout_policy = "AC"
        dsheet_itemcountry = "AD"
        dsheet_itemlocation = "AE"
        dsheet_ship_to_country = "AF"
        dsheet_exclude_shiptolocation = "AG"
        dsheet_ship_service = "AH"
        dsheet_first_post = "AI"
        dsheet_second_post = "AJ"
        dsheet_intl_ship_service = "AK"
        dsheet_intl_ship_location = "AL"
        dsheet_intl_first_post = "AM"
        dsheet_intl_second_post = "AN"
        dsheet_max_dispatch_time = "AO"
        dsheet_return_accepted = "AP"
        dsheet_return_refund = "AQ"
        dsheet_return_within = "AR"
        dsheet_return_shipby = "AS"
        dsheet_return_policy = "AT"
        dsheet_productsize = "AU"
        dsheet_receivedesc1 = "AV"
        dsheet_receivedesc2 = "AW"
        dsheet_receivedesc3 = "AX"
        dsheet_receivedesc4 = "AY"
        dsheet_receivedesc5 = "AZ"
        dsheet_maindesc01 = "BA"
        dsheet_maindesc02 = "BB"
        dsheet_maindesc03 = "BC"
        dsheet_maindesc04 = "BD"
        dsheet_maindesc05 = "BE"
        dsheet_maindesc06 = "BF"
        dsheet_maindesc07 = "BG"
        dsheet_maindesc08 = "BH"
        dsheet_maindesc09 = "BI"
        dsheet_maindesc10 = "BJ"
        dsheet_pictotal = "BK"
        dsheet_poster = "BL"
        dsheet_poster_link = "BM"
        dsheet_gallery = "BN"
        dsheet_gallerytype = "BO"
        dsheet_photofirst = "BP"
        dsheet_pic_use_actual_path = "BQ"
        dsheet_desc_use_actual_html = "BR"
        dsheet_cmptblty_use_profile = "BS"
        dsheet_pic_actual_paths = "BT"
        dsheet_condition_id = "BU"
        dsheet_condition_desc = "BV"
        dsheet_ebcategory = "BW"
        dsheet_ebcategory2 = "BX"
        dsheet_shopcategory1 = "BY"
        dsheet_shopcategory2 = "BZ"
        dsheet_sitecategory = "CA"
        dsheet_titleexternal = "CB"
        dsheet_subtitleexternal = "CC"
        dsheet_titleinternal = "CD"
        dsheet_item_specific_1 = "CE"
        dsheet_item_specific_2 = "CF"
        dsheet_item_specific_3 = "CG"
        dsheet_item_specific_4 = "CH"
        dsheet_item_specific_5 = "CI"
        dsheet_item_specific_6 = "CJ"
        dsheet_item_specific_7 = "CK"
        dsheet_item_specific_8 = "CL"
        dsheet_item_specific_9 = "CM"
        dsheet_item_specific_10 = "CN"
        dsheet_item_specific_11 = "CO"
        dsheet_item_specific_12 = "CP"
        dsheet_item_specific_13 = "CQ"
        dsheet_item_specific_14 = "CR"
        dsheet_item_specific_15 = "CS"
        dsheet_catalog_type = "CT"
        dsheet_catalog_id = "CU"
        dsheet_catalog_use_photo = "CV"
        dsheet_catalog_use_specific = "CW"
        dsheet_profile_idx = "CX"
        dsheet_cmptblty_profile_idx = "CY"
        dsheet_template_idx = "CZ"
        dsheet_attr_group = "DA"
        dsheet_privatelisting = "DB"
        dsheet_listenhancement = "DC"
        dsheet_keep_enabled = "DD"
        dsheet_EOF = "DE"

        
        -----------------------------------------------
        E_US站点参数
        
            Cells(i, dsheet_row_id) = ""
            Cells(i, dsheet_shop_initial) = "e"
            Cells(i, dsheet_sitecode) = "US"
            Cells(i, dsheet_currency) = "USD"
            Cells(i, dsheet_format) = "BIN"
            Cells(i, dsheet_duration) = "GTC"
            
            If basic_ismult = 1 Then

                arr_mv1_cod = Split(basic_mv1_code, ",")
                    
                len_mv1_cod = UBound(arr_mv1_cod)
                    
                arr_mv1_val = Split(basic_mv1_val, ",")
                    
                len_mv1_val = UBound(arr_mv1_val)
            
                If Trim(basic_mv3_val = "") Then
                
                    判断单SKU和单属性值
                    If Trim(basic_mv2_val = "") Then
                        
                        If len_mv1_cod = len_mv1_val Then
                        
                            
                            For mv1_i = 0 To len_mv1_cod
                            
                                Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                        
                                Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1_i)) & "/120129eusd"
                                
                                If arr_mv1_val(mv1_i) Like "x*" Then
                                
                                    Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1_i))
                                
                                Else
                                
                                    Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1_i))
                                
                                End If
                                
                                Cells(j, dsheet_var_upc) = "Does not apply"
                            
                                Cells(j, dsheet_lot_size) = 1
                            
                                Cells(j, dsheet_qty) = 15
                            
                                Cells(j, dsheet_price) = basic_price
                                
                                Cells(j, dsheet_EOF) = "o"
                            
                                j = j + 1
                                
                            Next
                            
                        Else
                        
                         MsgBox (basic_i & "row:length of mv1_code and mv1_val not same")
                         
                         Exit Sub
                        
                        End If
                    
                    判断单SKU双属性值,或者双SKU双属性值
                    Else
                    
                    arr_mv2_val = Split(basic_mv2_val, ",")
        
                    len_mv2_val = UBound(arr_mv2_val)
                    
                        判断单SKU双属性值
                        
                        If Trim(basic_mv2_code) = "" Then
                        
                            If (len_mv1_cod + 1) = (len_mv1_val + 1) * (len_mv2_val + 1) Then
                            
                                
                                使用mv_k定位循环双属性值
                                
                                mv_k = j
        
*****************************循环SKU编号
                            
                            For mv1code_i = 0 To len_mv1_cod
                            
                                Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                    
                                Cells(j, dsheet_product_code) = basic_sku & "-" & arr_mv1_cod(mv1code_i) & "/120129eusd"
                                
                                Cells(j, dsheet_var_upc) = "Does not apply"
                                    
                                Cells(j, dsheet_lot_size) = 1
                                    
                                Cells(j, dsheet_qty) = 15
                                    
                                Cells(j, dsheet_price) = basic_price
                                
                                Cells(j, dsheet_EOF) = "o"
                                    
                                j = j + 1
                            
                            Next
                                
                                
                                For len_mv1val_i = 0 To len_mv1_val
                                
                                    For len_mv2val_i = 0 To len_mv2_val
                                    
                                    
                                        判断属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv1_val(len_mv1val_i) Like "x*" Then
                                        
                                            Cells(mv_k, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(len_mv1val_i))
                                            
                                        Else
                                        
                                            Cells(mv_k, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(len_mv1val_i))
                                        
                                        End If
                                        
                                        
                                        判断属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv2_val(len_mv2val_i) Like "x*" Then
                                        
                                            Cells(mv_k, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(len_mv2val_i))
                                        
                                        Else
                                        
                                            Cells(mv_k, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(len_mv2val_i))
                                        
                                        End If
                                        
                                            
                                        mv_k = mv_k + 1
                                    
                                    Next
                                
                                Next
                                
                            Else
                        
                                MsgBox (basic_i & "row:len_mv1_cod!=len_mv1_val*len_mv2_val")
                                
                                Exit Sub
                        
                            End If
                        
                        双SKU双属性值
                        Else
                        
                            arr_mv2_cod = Split(basic_mv2_code, ",")
                    
                            len_mv2_cod = UBound(arr_mv2_cod)
                            
                            If len_mv1_cod <> len_mv1_val Then
                            
                                MsgBox (basic_i & "row:2/2 mode len_mv1_cod!=len_mv1_val")
                                
                                Exit Sub
                                
                            End If
                            
                            If len_mv2_cod <> len_mv2_val Then
                            
                                MsgBox (basic_i & "row:2/2 mode len_mv2_cod!=len_mv2_val")
                                
                                Exit Sub
                                
                            End If
                            
                            循环双SKU和双属性
                            
                            For mv1val_i = 0 To len_mv1_val
                                
                                For mv2val_i = 0 To len_mv2_val
                                
                                    Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                                        
                                    Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1val_i)) & UCase(arr_mv2_cod(mv2val_i)) & "/120129eusd"
                                        
                                    判断MV1属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                    If arr_mv1_val(mv1val_i) Like "x*" Then
                                        
                                        Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1val_i))
                                            
                                    Else
                                
                                        Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1val_i))
                                        
                                    End If
                                        
                                        
                                    判断MV2属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                    
                                    If arr_mv2_val(mv2val_i) Like "x*" Then
                                        
                                        Cells(j, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(mv2val_i))
                                        
                                    Else
                                        
                                        Cells(j, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(mv2val_i))
                                        
                                    End If
                                        
                                    Cells(j, dsheet_var_upc) = "Does not apply"
                                        
                                    Cells(j, dsheet_lot_size) = 1
                                        
                                    Cells(j, dsheet_qty) = 15
                                        
                                    Cells(j, dsheet_price) = basic_price
                                    
                                    Cells(j, dsheet_EOF) = "o"
                                        
                                    j = j + 1
                    
                                Next
                                
                            Next
                            
                        End If
                        
                    End If
**********************************************************
                Else

                    先获取mv3的值
                    
                    arr_mv3_val = Split(basic_mv3_val, ",")
        
                    len_mv3_val = UBound(arr_mv3_val)
                    
                    arr_mv2_val = Split(basic_mv2_val, ",")
        
                    len_mv2_val = UBound(arr_mv2_val)


                    判断双SKU,三属性值
                    
                    If basic_mv2_code <> "" And basic_mv3_code = "" Then

                        arr_mv2_cod = Split(basic_mv2_code, ",")
                    
                        len_mv2_cod = UBound(arr_mv2_cod)
                        
                        
                        If (len_mv1_cod + 1) * (len_mv2_cod + 1) = (len_mv1_val + 1) * (len_mv2_val + 1) * (len_mv3_val + 1) Then
                        
                            
                            mv_k3 = j
                        
                            For mv1code_i = 0 To len_mv1_cod
                            
                                For mv2code_i = 0 To len_mv2_cod
                            
                                    Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                        
                                    Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1code_i)) & UCase(arr_mv2_cod(mv2code_i)) & "/120129eusd"
                                    
                                    Cells(j, dsheet_var_upc) = "Does not apply"
                                        
                                    Cells(j, dsheet_lot_size) = 1
                                        
                                    Cells(j, dsheet_qty) = 15
                                        
                                    Cells(j, dsheet_price) = basic_price
                                    
                                    Cells(j, dsheet_EOF) = "o"
                                        
                                    j = j + 1
                                
                                Next
                            
                            Next
                            
                        
                            For mv1val_i = 0 To len_mv1_val
                                    
                                For mv2val_i = 0 To len_mv2_val
                                
                                    For mv3val_i = 0 To len_mv3_val
                                    
                                        
                                         判断MV1属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv1_val(mv1val_i) Like "x*" Then
                                            
                                            Cells(mv_k3, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1val_i))
                                                
                                        Else
                                    
                                            Cells(mv_k3, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1val_i))
                                            
                                        End If
                                        
                                        判断MV2属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv2_val(mv2val_i) Like "x*" Then
                                        
                                            
                                            Cells(mv_k3, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(mv2val_i))
                                            
                                        Else
                                            
                                            Cells(mv_k3, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(mv2val_i))
                                            
                                        End If
                                        
                                        
                                        判断MV3属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv3_val(mv3val_i) Like "x*" Then
                                        
                                            
                                            Cells(mv_k3, dsheet_var_child_var3) = Application.Proper(basic_mv3_att) & ":" & UCase(arr_mv3_val(mv3val_i))
                                            
                                            
                                        Else
                                            
                                            Cells(mv_k3, dsheet_var_child_var3) = Application.Proper(basic_mv3_att & ":" & arr_mv3_val(mv3val_i))
                                            
                                        End If
                                             
                                        mv_k3 = mv_k3 + 1
                                        
                                    Next
                                    
                                Next
                                
                            Next
                        Else
                        
                            MsgBox (basic_i & "row:2SKU/3colum len_cod!=len_val")
                                
                            Exit Sub
                        
                        End If

                    判断单SKU,三属性值
                    
                    ElseIf basic_mv2_code = "" And basic_mv3_code = "" Then
                    
                        If (len_mv1_cod + 1) = (len_mv1_val + 1) * (len_mv2_val + 1) * (len_mv3_val + 1) Then
                        
                        
                            mv_k3 = j
                        
                            For mv1code_i = 0 To len_mv1_cod
                            
                                Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                    
                                Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1code_i)) & "/120129eusd"
                                
                                Cells(j, dsheet_var_upc) = "Does not apply"
                                    
                                Cells(j, dsheet_lot_size) = 1
                                    
                                Cells(j, dsheet_qty) = 15
                                    
                                Cells(j, dsheet_price) = basic_price
                                
                                Cells(j, dsheet_EOF) = "o"
                                    
                                j = j + 1
                            
                            Next
                
                            For mv1val_i = 0 To len_mv1_val
                                        
                                    For mv2val_i = 0 To len_mv2_val
                                    
                                        For mv3val_i = 0 To len_mv3_val
                                        
                                            
                                             判断MV1属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                            
                                            If arr_mv1_val(mv1val_i) Like "x*" Then
                                                
                                                Cells(mv_k3, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1val_i))
                                                    
                                            Else
                                        
                                                Cells(mv_k3, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1val_i))
                                                
                                            End If
                                            
                                            判断MV2属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                            
                                            If arr_mv2_val(mv2val_i) Like "x*" Then
                                            
                                                
                                                Cells(mv_k3, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(mv2val_i))
                                                
                                            Else
                                                
                                                Cells(mv_k3, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(mv2val_i))
                                                
                                            End If
                                            
                                            
                                            判断MV3属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                            If arr_mv3_val(mv3val_i) Like "x*" Then
                                            
                                                
                                                Cells(mv_k3, dsheet_var_child_var3) = Application.Proper(basic_mv3_att) & ":" & UCase(arr_mv3_val(mv3val_i))
                                                
                                                
                                            Else
                                                
                                                Cells(mv_k3, dsheet_var_child_var3) = Application.Proper(basic_mv3_att & ":" & arr_mv3_val(mv3val_i))
                                                
                                            End If
                                                
                                            mv_k3 = mv_k3 + 1
                                            
                                        Next
                                        
                                    Next
                                    
                                Next
                                
                            Else
                            
                                MsgBox (basic_i & "row:1SKU/3colum len_cod!=len_val")
                                
                                Exit Sub
                            
                            End If
                    
                    
                    判断三SKU,三属性值
                    
                    ElseIf basic_mv2_code <> "" And basic_mv3_code <> "" Then
                    
                        arr_mv2_cod = Split(basic_mv2_code, ",")
                    
                        len_mv2_cod = UBound(arr_mv2_cod)
                        
                        arr_mv3_cod = Split(basic_mv3_code, ",")
                    
                        len_mv3_cod = UBound(arr_mv3_cod)
                        
                        
                        If len_mv1_cod <> len_mv1_val Then
                            
                                MsgBox (basic_i & "row:3/3 mode len_mv1_cod!=len_mv1_val")
                                
                                Exit Sub
                                
                            End If
                            
                        If len_mv2_cod <> len_mv2_val Then
                            
                            MsgBox (basic_i & "row:3/3 mode len_mv2_cod!=len_mv2_val")
                                
                            Exit Sub
                                
                        End If
                        
                        If len_mv3_cod <> len_mv3_val Then
                            
                            MsgBox (basic_i & "row:3/3 mode len_mv3_cod!=len_mv3_val")
                                
                            Exit Sub
                                
                        End If
                        
                        
                        循环三属性
                        
                        For mv1val_i = 0 To len_mv1_val
                                    
                                For mv2val_i = 0 To len_mv2_val
                                
                                    For mv3val_i = 0 To len_mv3_val
                                    
                                        Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                                            
                                        Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1val_i)) & UCase(arr_mv2_cod(mv2val_i)) & UCase(arr_mv3_cod(mv3val_i)) & "/120129eusd"
                                        
                                         判断MV1属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv1_val(mv1val_i) Like "x*" Then
                                            
                                            Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1val_i))
                                                
                                        Else
                                    
                                            Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1val_i))
                                            
                                        End If
                                        
                                        判断MV2属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv2_val(mv2val_i) Like "x*" Then
                                        
                                            
                                            Cells(j, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(mv2val_i))
                                            
                                        Else
                                            
                                            Cells(j, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(mv2val_i))
                                            
                                        End If
                                        
                                        
                                        判断MV3属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        If arr_mv3_val(mv3val_i) Like "x*" Then
                                        
                                            
                                            Cells(j, dsheet_var_child_var3) = Application.Proper(basic_mv3_att) & ":" & UCase(arr_mv3_val(mv3val_i))
                                            
                                            
                                        Else
                                            
                                            Cells(j, dsheet_var_child_var3) = Application.Proper(basic_mv3_att & ":" & arr_mv3_val(mv3val_i))
                                            
                                        End If
                                            
                                        Cells(j, dsheet_var_upc) = "Does not apply"
                                            
                                        Cells(j, dsheet_lot_size) = 1
                                            
                                        Cells(j, dsheet_qty) = 15
                                            
                                        Cells(j, dsheet_price) = basic_price
                                        
                                        Cells(j, dsheet_EOF) = "o"
                                            
                                        j = j + 1
                                        
                                    Next
                                    
                                Next
                                
                            Next

                    Else
                    
                        MsgBox ("Extra Useless Colum")

                    End If


                End If
**************************
            ElseIf basic_ismult = 0 Then
            
                Cells(j, dsheet_lot_size) = 1
                    
                Cells(j, dsheet_qty) = 15
                    
                Cells(j, dsheet_price) = basic_price
                
                Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                
                Cells(j, dsheet_product_code) = basic_sku & "/120129eusd-P"
                
                j = j + 1
                
            Else
            
                MsgBox ("ismult error/#N/A")
                Rows(i).Delete
                Exit Sub
                    
            End If
                
                
            Cells(i, dsheet_remark) = ""            Cells(i, dsheet_var_photo) = ""            Cells(i, dsheet_var_child_var3) = ""            Cells(i, dsheet_var_child_var4) = ""            Cells(i, dsheet_var_child_var5) = ""            Cells(i, dsheet_discount_profileid) = ""
            Cells(i, dsheet_isoffer) = 0
            Cells(i, dsheet_rejectamt) = 0
            Cells(i, dsheet_acceptamt) = 0
            Cells(i, dsheet_payment_method) = "PayPal"
            
            If Cells(i, dsheet_price) > 4.99 Then
            
            
                Cells(i, dsheet_paypal_email) = "etrs2013@gmail.com"
                
                Cells(i, dsheet_ship_service) = "ePacketChina"
                
            ElseIf Cells(i, dsheet_price) < 5 And Cells(i, dsheet_price) > 0 Then
            
                
                Cells(i, dsheet_ship_service) = "EconomyShippingFromOutsideUS"
                
                Cells(i, dsheet_paypal_email) = "ppsoonhua@163.com"
                
                
            End If
                
            Cells(i, dsheet_autopay) = 0
            Cells(i, dsheet_checkout_policy) = ""
            Cells(i, dsheet_itemcountry) = "CN"
            Cells(i, dsheet_itemlocation) = "Shenzhen"
            Cells(i, dsheet_ship_to_country) = "Worldwide"
            Cells(i, dsheet_exclude_shiptolocation) = ""
            Cells(i, dsheet_first_post) = 0
            Cells(i, dsheet_second_post) = 0
            Cells(i, dsheet_intl_ship_service) = "StandardInternational"
            Cells(i, dsheet_intl_ship_location) = "Worldwide"
            Cells(i, dsheet_intl_first_post) = 0
            Cells(i, dsheet_intl_second_post) = 0
            Cells(i, dsheet_max_dispatch_time) = 2
            Cells(i, dsheet_return_accepted) = "ReturnsAccepted"
            Cells(i, dsheet_return_refund) = "MoneyBackOrExchange"
            Cells(i, dsheet_return_within) = "Days_14"
            Cells(i, dsheet_return_shipby) = "Buyer"
            Cells(i, dsheet_return_policy) = "Restocking fees: No"
            Cells(i, dsheet_productsize) = ""            Cells(i, dsheet_receivedesc1) = ""            Cells(i, dsheet_receivedesc2) = ""            Cells(i, dsheet_receivedesc3) = ""            Cells(i, dsheet_receivedesc4) = ""            Cells(i, dsheet_receivedesc5) = ""
            Cells(i, dsheet_maindesc01) = basic_description     产品内容文字描述            Cells(i, dsheet_maindesc02) = ""            Cells(i, dsheet_maindesc03) = ""            Cells(i, dsheet_maindesc04) = ""            Cells(i, dsheet_maindesc05) = ""            Cells(i, dsheet_maindesc06) = ""            Cells(i, dsheet_maindesc07) = ""            Cells(i, dsheet_maindesc08) = ""            Cells(i, dsheet_maindesc09) = ""            Cells(i, dsheet_maindesc10) = ""
            Cells(i, dsheet_pictotal) = 0
            Cells(i, dsheet_poster) = ""            Cells(i, dsheet_poster_link) = ""
            Cells(i, dsheet_gallery) = basic_photo
            Cells(i, dsheet_gallerytype) = "Gallery"
            Cells(i, dsheet_photofirst) = ""
            Cells(i, dsheet_pic_use_actual_path) = 1
            Cells(i, dsheet_desc_use_actual_html) = 0
            Cells(i, dsheet_cmptblty_use_profile) = 0
            Cells(i, dsheet_pic_actual_paths) = ""
            Cells(i, dsheet_condition_id) = 1000
            Cells(i, dsheet_condition_desc) = ""
            Cells(i, dsheet_ebcategory) = basic_ebay_cat1
            Cells(i, dsheet_ebcategory2) = basic_ebay_cat2
            Cells(i, dsheet_shopcategory1) = basic_shop_cat1            Cells(i, dsheet_shopcategory2) = basic_shop_cat2            Cells(i, dsheet_sitecategory) = ""
            Cells(i, dsheet_titleexternal) = Trim(Replace(basic_title, Chr(10), ""))
            Cells(i, dsheet_subtitleexternal) = ""
            Cells(i, dsheet_titleinternal) = Trim(Replace(basic_title, Chr(10), ""))
            
            Cells(i, dsheet_item_specific_1) = "Brand:Unbranded"
            Cells(i, dsheet_item_specific_2) = "MPN:Does not apply"
            If basic_ismult <> 1 Then Cells(i, dsheet_item_specific_3) = "UPC:Does not apply"
            Cells(i, dsheet_item_specific_4) = Trim(basic_item_spec4)
            Cells(i, dsheet_item_specific_5) = Trim(basic_item_spec5)
            Cells(i, dsheet_item_specific_6) = Trim(basic_item_spec6)
            Cells(i, dsheet_item_specific_7) = Trim(basic_item_spec7)
            Cells(i, dsheet_item_specific_8) = Trim(basic_item_spec8)
            Cells(i, dsheet_item_specific_9) = Trim(basic_item_spec9)
            Cells(i, dsheet_item_specific_10) = Trim(basic_item_spec10)
            Cells(i, dsheet_item_specific_11) = Trim(basic_item_spec11)
            Cells(i, dsheet_item_specific_12) = Trim(basic_item_spec12)
            Cells(i, dsheet_item_specific_13) = Trim(basic_item_spec13)
            Cells(i, dsheet_item_specific_14) = Trim(basic_item_spec14)
            Cells(i, dsheet_item_specific_15) = Trim(basic_item_spec15)
            Cells(i, dsheet_catalog_type) = ""            Cells(i, dsheet_catalog_id) = ""
            Cells(i, dsheet_catalog_use_photo) = 0
            Cells(i, dsheet_catalog_use_specific) = 0
            Cells(i, dsheet_profile_idx) = ""            Cells(i, dsheet_cmptblty_profile_idx) = ""
            Cells(i, dsheet_template_idx) = 2362
            Cells(i, dsheet_attr_group) = ""
            Cells(i, dsheet_privatelisting) = 1
            Cells(i, dsheet_listenhancement) = ""
            Cells(i, dsheet_keep_enabled) = 0
            Cells(i, dsheet_EOF) = 0
            i = j
        
        basic_i = basic_i + 1
    Loop
        
    End With

End Sub

 

 

 

 

 

 

 

 

 

Sub E_US刊登模板0420()

        ‘basic表单参数
        
    With Sheets("basic")
    
    basic_cnt = .Range("a63556").End(xlUp).Row
    
    basic_i = 2
    
    ‘export-20130124表格的起始点,用j来递增多属性,完成后返还给i;
    
    i = 3
        
    Do While basic_i <= basic_cnt
        
        
        basic_sku = .Cells(basic_i, "a")
        basic_site = .Cells(basic_i, "b")
        basic_price = .Cells(basic_i, "c")
        basic_ismult = .Cells(basic_i, "d")
        basic_mv1_code = .Cells(basic_i, "e")
        basic_mv1_att = .Cells(basic_i, "f")
        basic_mv1_val = .Cells(basic_i, "g")
        basic_mv2_code = .Cells(basic_i, "h")
        basic_mv2_att = .Cells(basic_i, "i")
        basic_mv2_val = .Cells(basic_i, "j")
        basic_mv3_code = .Cells(basic_i, "k")
        basic_mv3_att = .Cells(basic_i, "l")
        basic_mv3_val = .Cells(basic_i, "m")
        basic_title = .Cells(basic_i, "n")
        basic_description = .Cells(basic_i, "o")
        basic_ebay_cat1 = .Cells(basic_i, "p")
        basic_ebay_cat2 = .Cells(basic_i, "q")
        basic_item_spec4 = .Cells(basic_i, "r")
        basic_item_spec5 = .Cells(basic_i, "s")
        basic_item_spec6 = .Cells(basic_i, "t")
        basic_item_spec7 = .Cells(basic_i, "u")
        basic_item_spec8 = .Cells(basic_i, "v")
        basic_item_spec9 = .Cells(basic_i, "w")
        basic_item_spec10 = .Cells(basic_i, "x")
        basic_item_spec11 = .Cells(basic_i, "y")
        basic_item_spec12 = .Cells(basic_i, "z")
        basic_item_spec13 = .Cells(basic_i, "aa")
        basic_item_spec14 = .Cells(basic_i, "ab")
        basic_item_spec15 = .Cells(basic_i, "ac")
        basic_photo = .Cells(basic_i, "ad")
    
        
        ‘j来引导下一个多属性
        j = i
        
        
        ‘----------------------------
        ‘数据表列号
        dsheet_row_id = "A"
        dsheet_shop_initial = "B"
        dsheet_sitecode = "C"
        dsheet_currency = "D"
        dsheet_format = "E"
        dsheet_duration = "F"
        dsheet_var_parent_sku = "G"
        dsheet_product_code = "H"
        dsheet_remark = "I"
        dsheet_var_photo = "J"
        dsheet_var_child_var1 = "K"
        dsheet_var_child_var2 = "L"
        dsheet_var_child_var3 = "M"
        dsheet_var_child_var4 = "N"
        dsheet_var_child_var5 = "O"
        dsheet_var_ean = "P"
        dsheet_var_upc = "Q"
        dsheet_var_isbn = "R"
        dsheet_lot_size = "S"
        dsheet_qty = "T"
        dsheet_price = "U"
        dsheet_discount_profileid = "V"
        dsheet_isoffer = "W"
        dsheet_rejectamt = "X"
        dsheet_acceptamt = "Y"
        dsheet_payment_method = "Z"
        dsheet_paypal_email = "AA"
        dsheet_autopay = "AB"
        dsheet_checkout_policy = "AC"
        dsheet_itemcountry = "AD"
        dsheet_itemlocation = "AE"
        dsheet_ship_to_country = "AF"
        dsheet_exclude_shiptolocation = "AG"
        dsheet_ship_service = "AH"
        dsheet_first_post = "AI"
        dsheet_second_post = "AJ"
        dsheet_intl_ship_service = "AK"
        dsheet_intl_ship_location = "AL"
        dsheet_intl_first_post = "AM"
        dsheet_intl_second_post = "AN"
        dsheet_max_dispatch_time = "AO"
        dsheet_return_accepted = "AP"
        dsheet_return_refund = "AQ"
        dsheet_return_within = "AR"
        dsheet_return_shipby = "AS"
        dsheet_return_policy = "AT"
        dsheet_productsize = "AU"
        dsheet_receivedesc1 = "AV"
        dsheet_receivedesc2 = "AW"
        dsheet_receivedesc3 = "AX"
        dsheet_receivedesc4 = "AY"
        dsheet_receivedesc5 = "AZ"
        dsheet_maindesc01 = "BA"
        dsheet_maindesc02 = "BB"
        dsheet_maindesc03 = "BC"
        dsheet_maindesc04 = "BD"
        dsheet_maindesc05 = "BE"
        dsheet_maindesc06 = "BF"
        dsheet_maindesc07 = "BG"
        dsheet_maindesc08 = "BH"
        dsheet_maindesc09 = "BI"
        dsheet_maindesc10 = "BJ"
        dsheet_pictotal = "BK"
        dsheet_poster = "BL"
        dsheet_poster_link = "BM"
        dsheet_gallery = "BN"
        dsheet_gallerytype = "BO"
        dsheet_photofirst = "BP"
        dsheet_pic_use_actual_path = "BQ"
        dsheet_desc_use_actual_html = "BR"
        dsheet_cmptblty_use_profile = "BS"
        dsheet_pic_actual_paths = "BT"
        dsheet_condition_id = "BU"
        dsheet_condition_desc = "BV"
        dsheet_ebcategory = "BW"
        dsheet_ebcategory2 = "BX"
        dsheet_shopcategory1 = "BY"
        dsheet_shopcategory2 = "BZ"
        dsheet_sitecategory = "CA"
        dsheet_titleexternal = "CB"
        dsheet_subtitleexternal = "CC"
        dsheet_titleinternal = "CD"
        dsheet_item_specific_1 = "CE"
        dsheet_item_specific_2 = "CF"
        dsheet_item_specific_3 = "CG"
        dsheet_item_specific_4 = "CH"
        dsheet_item_specific_5 = "CI"
        dsheet_item_specific_6 = "CJ"
        dsheet_item_specific_7 = "CK"
        dsheet_item_specific_8 = "CL"
        dsheet_item_specific_9 = "CM"
        dsheet_item_specific_10 = "CN"
        dsheet_item_specific_11 = "CO"
        dsheet_item_specific_12 = "CP"
        dsheet_item_specific_13 = "CQ"
        dsheet_item_specific_14 = "CR"
        dsheet_item_specific_15 = "CS"
        dsheet_catalog_type = "CT"
        dsheet_catalog_id = "CU"
        dsheet_catalog_use_photo = "CV"
        dsheet_catalog_use_specific = "CW"
        dsheet_profile_idx = "CX"
        dsheet_cmptblty_profile_idx = "CY"
        dsheet_template_idx = "CZ"
        dsheet_attr_group = "DA"
        dsheet_privatelisting = "DB"
        dsheet_listenhancement = "DC"
        dsheet_keep_enabled = "DD"
        dsheet_EOF = "DE"

        
        ‘-----------------------------------------------
        ‘E_US站点参数
        
            Cells(i, dsheet_row_id) = ""
            Cells(i, dsheet_shop_initial) = "e"
            Cells(i, dsheet_sitecode) = "US"
            Cells(i, dsheet_currency) = "USD"
            Cells(i, dsheet_format) = "BIN"
            Cells(i, dsheet_duration) = "GTC"
            
            If basic_ismult = 1 Then

                arr_mv1_cod = Split(basic_mv1_code, ",")
                    
                len_mv1_cod = UBound(arr_mv1_cod)
                    
                arr_mv1_val = Split(basic_mv1_val, ",")
                    
                len_mv1_val = UBound(arr_mv1_val)
            
                If Trim(basic_mv3_val = "") Then
                
                    ‘判断单SKU和单属性值
                    If Trim(basic_mv2_val = "") Then
                        
                        If len_mv1_cod = len_mv1_val Then
                        
                            
                            For mv1_i = 0 To len_mv1_cod
                            
                                Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                        
                                Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1_i)) & "/120129eusd"
                                
                                If arr_mv1_val(mv1_i) Like "x*" Then
                                
                                    Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1_i))
                                
                                Else
                                
                                    Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1_i))
                                
                                End If
                                
                                Cells(j, dsheet_var_upc) = "Does not apply"
                            
                                Cells(j, dsheet_lot_size) = 1
                            
                                Cells(j, dsheet_qty) = 15
                            
                                Cells(j, dsheet_price) = basic_price
                                
                                Cells(j, dsheet_EOF) = "o"
                            
                                j = j + 1
                                
                            Next
                            
                        Else
                        
                         MsgBox (basic_i & "row:length of mv1_code and mv1_val not same")
                         
                         Exit Sub
                        
                        End If
                    
                    ‘判断单SKU双属性值,或者双SKU双属性值
                    Else
                    
                    arr_mv2_val = Split(basic_mv2_val, ",")
        
                    len_mv2_val = UBound(arr_mv2_val)
                    
                        ‘判断单SKU双属性值
                        
                        If Trim(basic_mv2_code) = "" Then
                        
                            If (len_mv1_cod + 1) = (len_mv1_val + 1) * (len_mv2_val + 1) Then
                            
                                
                                ‘使用mv_k定位循环双属性值
                                
                                mv_k = j
        
‘*****************************循环SKU编号
                            
                            For mv1code_i = 0 To len_mv1_cod
                            
                                Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                    
                                Cells(j, dsheet_product_code) = basic_sku & "-" & arr_mv1_cod(mv1code_i) & "/120129eusd"
                                
                                Cells(j, dsheet_var_upc) = "Does not apply"
                                    
                                Cells(j, dsheet_lot_size) = 1
                                    
                                Cells(j, dsheet_qty) = 15
                                    
                                Cells(j, dsheet_price) = basic_price
                                
                                Cells(j, dsheet_EOF) = "o"
                                    
                                j = j + 1
                            
                            Next
                                
                                
                                For len_mv1val_i = 0 To len_mv1_val
                                
                                    For len_mv2val_i = 0 To len_mv2_val
                                    
                                    
                                        ‘判断属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv1_val(len_mv1val_i) Like "x*" Then
                                        
                                            Cells(mv_k, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(len_mv1val_i))
                                            
                                        Else
                                        
                                            Cells(mv_k, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(len_mv1val_i))
                                        
                                        End If
                                        
                                        
                                        ‘判断属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv2_val(len_mv2val_i) Like "x*" Then
                                        
                                            Cells(mv_k, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(len_mv2val_i))
                                        
                                        Else
                                        
                                            Cells(mv_k, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(len_mv2val_i))
                                        
                                        End If
                                        
                                            
                                        mv_k = mv_k + 1
                                    
                                    Next
                                
                                Next
                                
                            Else
                        
                                MsgBox (basic_i & "row:len_mv1_cod!=len_mv1_val*len_mv2_val")
                                
                                Exit Sub
                        
                            End If
                        
                        ‘双SKU双属性值
                        Else
                        
                            arr_mv2_cod = Split(basic_mv2_code, ",")
                    
                            len_mv2_cod = UBound(arr_mv2_cod)
                            
                            If len_mv1_cod <> len_mv1_val Then
                            
                                MsgBox (basic_i & "row:2/2 mode len_mv1_cod!=len_mv1_val")
                                
                                Exit Sub
                                
                            End If
                            
                            If len_mv2_cod <> len_mv2_val Then
                            
                                MsgBox (basic_i & "row:2/2 mode len_mv2_cod!=len_mv2_val")
                                
                                Exit Sub
                                
                            End If
                            
                            ‘循环双SKU和双属性
                            
                            For mv1val_i = 0 To len_mv1_val
                                
                                For mv2val_i = 0 To len_mv2_val
                                
                                    Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                                        
                                    Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1val_i)) & UCase(arr_mv2_cod(mv2val_i)) & "/120129eusd"
                                        
                                    ‘判断MV1属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                    If arr_mv1_val(mv1val_i) Like "x*" Then
                                        
                                        Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1val_i))
                                            
                                    Else
                                
                                        Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1val_i))
                                        
                                    End If
                                        
                                        
                                    ‘判断MV2属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                    
                                    If arr_mv2_val(mv2val_i) Like "x*" Then
                                        
                                        Cells(j, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(mv2val_i))
                                        
                                    Else
                                        
                                        Cells(j, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(mv2val_i))
                                        
                                    End If
                                        
                                    Cells(j, dsheet_var_upc) = "Does not apply"
                                        
                                    Cells(j, dsheet_lot_size) = 1
                                        
                                    Cells(j, dsheet_qty) = 15
                                        
                                    Cells(j, dsheet_price) = basic_price
                                    
                                    Cells(j, dsheet_EOF) = "o"
                                        
                                    j = j + 1
                    
                                Next
                                
                            Next
                            
                        End If
                        
                    End If
‘**********************************************************
                Else

                    ‘先获取mv3的值
                    
                    arr_mv3_val = Split(basic_mv3_val, ",")
        
                    len_mv3_val = UBound(arr_mv3_val)
                    
                    arr_mv2_val = Split(basic_mv2_val, ",")
        
                    len_mv2_val = UBound(arr_mv2_val)


                    ‘判断双SKU,三属性值
                    
                    If basic_mv2_code <> "" And basic_mv3_code = "" Then

                        arr_mv2_cod = Split(basic_mv2_code, ",")
                    
                        len_mv2_cod = UBound(arr_mv2_cod)
                        
                        
                        If (len_mv1_cod + 1) * (len_mv2_cod + 1) = (len_mv1_val + 1) * (len_mv2_val + 1) * (len_mv3_val + 1) Then
                        
                            
                            mv_k3 = j
                        
                            For mv1code_i = 0 To len_mv1_cod
                            
                                For mv2code_i = 0 To len_mv2_cod
                            
                                    Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                        
                                    Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1code_i)) & UCase(arr_mv2_cod(mv2code_i)) & "/120129eusd"
                                    
                                    Cells(j, dsheet_var_upc) = "Does not apply"
                                        
                                    Cells(j, dsheet_lot_size) = 1
                                        
                                    Cells(j, dsheet_qty) = 15
                                        
                                    Cells(j, dsheet_price) = basic_price
                                    
                                    Cells(j, dsheet_EOF) = "o"
                                        
                                    j = j + 1
                                
                                Next
                            
                            Next
                            
                        
                            For mv1val_i = 0 To len_mv1_val
                                    
                                For mv2val_i = 0 To len_mv2_val
                                
                                    For mv3val_i = 0 To len_mv3_val
                                    
                                        
                                         ‘判断MV1属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv1_val(mv1val_i) Like "x*" Then
                                            
                                            Cells(mv_k3, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1val_i))
                                                
                                        Else
                                    
                                            Cells(mv_k3, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1val_i))
                                            
                                        End If
                                        
                                        ‘判断MV2属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv2_val(mv2val_i) Like "x*" Then
                                        
                                            
                                            Cells(mv_k3, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(mv2val_i))
                                            
                                        Else
                                            
                                            Cells(mv_k3, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(mv2val_i))
                                            
                                        End If
                                        
                                        
                                        ‘判断MV3属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv3_val(mv3val_i) Like "x*" Then
                                        
                                            
                                            Cells(mv_k3, dsheet_var_child_var3) = Application.Proper(basic_mv3_att) & ":" & UCase(arr_mv3_val(mv3val_i))
                                            
                                            
                                        Else
                                            
                                            Cells(mv_k3, dsheet_var_child_var3) = Application.Proper(basic_mv3_att & ":" & arr_mv3_val(mv3val_i))
                                            
                                        End If
                                             
                                        mv_k3 = mv_k3 + 1
                                        
                                    Next
                                    
                                Next
                                
                            Next
                        Else
                        
                            MsgBox (basic_i & "row:2SKU/3colum len_cod!=len_val")
                                
                            Exit Sub
                        
                        End If

                    ‘判断单SKU,三属性值
                    
                    ElseIf basic_mv2_code = "" And basic_mv3_code = "" Then
                    
                        If (len_mv1_cod + 1) = (len_mv1_val + 1) * (len_mv2_val + 1) * (len_mv3_val + 1) Then
                        
                        
                            mv_k3 = j
                        
                            For mv1code_i = 0 To len_mv1_cod
                            
                                Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                    
                                Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1code_i)) & "/120129eusd"
                                
                                Cells(j, dsheet_var_upc) = "Does not apply"
                                    
                                Cells(j, dsheet_lot_size) = 1
                                    
                                Cells(j, dsheet_qty) = 15
                                    
                                Cells(j, dsheet_price) = basic_price
                                
                                Cells(j, dsheet_EOF) = "o"
                                    
                                j = j + 1
                            
                            Next
                
                            For mv1val_i = 0 To len_mv1_val
                                        
                                    For mv2val_i = 0 To len_mv2_val
                                    
                                        For mv3val_i = 0 To len_mv3_val
                                        
                                            
                                             ‘判断MV1属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                            
                                            If arr_mv1_val(mv1val_i) Like "x*" Then
                                                
                                                Cells(mv_k3, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1val_i))
                                                    
                                            Else
                                        
                                                Cells(mv_k3, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1val_i))
                                                
                                            End If
                                            
                                            ‘判断MV2属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                            
                                            If arr_mv2_val(mv2val_i) Like "x*" Then
                                            
                                                
                                                Cells(mv_k3, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(mv2val_i))
                                                
                                            Else
                                                
                                                Cells(mv_k3, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(mv2val_i))
                                                
                                            End If
                                            
                                            
                                            ‘判断MV3属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                            If arr_mv3_val(mv3val_i) Like "x*" Then
                                            
                                                
                                                Cells(mv_k3, dsheet_var_child_var3) = Application.Proper(basic_mv3_att) & ":" & UCase(arr_mv3_val(mv3val_i))
                                                
                                                
                                            Else
                                                
                                                Cells(mv_k3, dsheet_var_child_var3) = Application.Proper(basic_mv3_att & ":" & arr_mv3_val(mv3val_i))
                                                
                                            End If
                                                
                                            mv_k3 = mv_k3 + 1
                                            
                                        Next
                                        
                                    Next
                                    
                                Next
                                
                            Else
                            
                                MsgBox (basic_i & "row:1SKU/3colum len_cod!=len_val")
                                
                                Exit Sub
                            
                            End If
                    
                    
                    ‘判断三SKU,三属性值
                    
                    ElseIf basic_mv2_code <> "" And basic_mv3_code <> "" Then
                    
                        arr_mv2_cod = Split(basic_mv2_code, ",")
                    
                        len_mv2_cod = UBound(arr_mv2_cod)
                        
                        arr_mv3_cod = Split(basic_mv3_code, ",")
                    
                        len_mv3_cod = UBound(arr_mv3_cod)
                        
                        
                        If len_mv1_cod <> len_mv1_val Then
                            
                                MsgBox (basic_i & "row:3/3 mode len_mv1_cod!=len_mv1_val")
                                
                                Exit Sub
                                
                            End If
                            
                        If len_mv2_cod <> len_mv2_val Then
                            
                            MsgBox (basic_i & "row:3/3 mode len_mv2_cod!=len_mv2_val")
                                
                            Exit Sub
                                
                        End If
                        
                        If len_mv3_cod <> len_mv3_val Then
                            
                            MsgBox (basic_i & "row:3/3 mode len_mv3_cod!=len_mv3_val")
                                
                            Exit Sub
                                
                        End If
                        
                        
                        ‘循环三属性
                        
                        For mv1val_i = 0 To len_mv1_val
                                    
                                For mv2val_i = 0 To len_mv2_val
                                
                                    For mv3val_i = 0 To len_mv3_val
                                    
                                        Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                                            
                                        Cells(j, dsheet_product_code) = basic_sku & "-" & UCase(arr_mv1_cod(mv1val_i)) & UCase(arr_mv2_cod(mv2val_i)) & UCase(arr_mv3_cod(mv3val_i)) & "/120129eusd"
                                        
                                         ‘判断MV1属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv1_val(mv1val_i) Like "x*" Then
                                            
                                            Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att) & ":" & UCase(arr_mv1_val(mv1val_i))
                                                
                                        Else
                                    
                                            Cells(j, dsheet_var_child_var1) = Application.Proper(basic_mv1_att & ":" & arr_mv1_val(mv1val_i))
                                            
                                        End If
                                        
                                        ‘判断MV2属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        
                                        If arr_mv2_val(mv2val_i) Like "x*" Then
                                        
                                            
                                            Cells(j, dsheet_var_child_var2) = Application.Proper(basic_mv2_att) & ":" & UCase(arr_mv2_val(mv2val_i))
                                            
                                        Else
                                            
                                            Cells(j, dsheet_var_child_var2) = Application.Proper(basic_mv2_att & ":" & arr_mv2_val(mv2val_i))
                                            
                                        End If
                                        
                                        
                                        ‘判断MV3属性值有没有XL,用Application.Proper只能首字母大写,无法让全部字母大写
                                        If arr_mv3_val(mv3val_i) Like "x*" Then
                                        
                                            
                                            Cells(j, dsheet_var_child_var3) = Application.Proper(basic_mv3_att) & ":" & UCase(arr_mv3_val(mv3val_i))
                                            
                                            
                                        Else
                                            
                                            Cells(j, dsheet_var_child_var3) = Application.Proper(basic_mv3_att & ":" & arr_mv3_val(mv3val_i))
                                            
                                        End If
                                            
                                        Cells(j, dsheet_var_upc) = "Does not apply"
                                            
                                        Cells(j, dsheet_lot_size) = 1
                                            
                                        Cells(j, dsheet_qty) = 15
                                            
                                        Cells(j, dsheet_price) = basic_price
                                        
                                        Cells(j, dsheet_EOF) = "o"
                                            
                                        j = j + 1
                                        
                                    Next
                                    
                                Next
                                
                            Next

                    Else
                    
                        MsgBox ("Extra Useless Colum")

                    End If


                End If
‘**************************
            ElseIf basic_ismult = 0 Then
            
                Cells(j, dsheet_lot_size) = 1
                    
                Cells(j, dsheet_qty) = 15
                    
                Cells(j, dsheet_price) = basic_price
                
                Cells(j, dsheet_var_parent_sku) = basic_sku & "/120129eusd-P"
                
                Cells(j, dsheet_product_code) = basic_sku & "/120129eusd-P"
                
                j = j + 1
                
            Else
            
                MsgBox ("ismult error/#N/A")
                Rows(i).Delete
                Exit Sub
                    
            End If
                
                
‘            Cells(i, dsheet_remark) = ""
‘            Cells(i, dsheet_var_photo) = ""
‘            Cells(i, dsheet_var_child_var3) = ""
‘            Cells(i, dsheet_var_child_var4) = ""
‘            Cells(i, dsheet_var_child_var5) = ""
‘            Cells(i, dsheet_discount_profileid) = ""
            Cells(i, dsheet_isoffer) = 0
            Cells(i, dsheet_rejectamt) = 0
            Cells(i, dsheet_acceptamt) = 0
            Cells(i, dsheet_payment_method) = "PayPal"
            
            If Cells(i, dsheet_price) > 4.99 Then
            
            
                Cells(i, dsheet_paypal_email) = "etrs2013@gmail.com"
                
                Cells(i, dsheet_ship_service) = "ePacketChina"
                
            ElseIf Cells(i, dsheet_price) < 5 And Cells(i, dsheet_price) > 0 Then
            
                
                Cells(i, dsheet_ship_service) = "EconomyShippingFromOutsideUS"
                
                Cells(i, dsheet_paypal_email) = "ppsoonhua@163.com"
                
                
            End If
                
            Cells(i, dsheet_autopay) = 0
‘            Cells(i, dsheet_checkout_policy) = ""
            Cells(i, dsheet_itemcountry) = "CN"
            Cells(i, dsheet_itemlocation) = "Shenzhen"
            Cells(i, dsheet_ship_to_country) = "Worldwide"
‘            Cells(i, dsheet_exclude_shiptolocation) = ""
            Cells(i, dsheet_first_post) = 0
            Cells(i, dsheet_second_post) = 0
            Cells(i, dsheet_intl_ship_service) = "StandardInternational"
            Cells(i, dsheet_intl_ship_location) = "Worldwide"
            Cells(i, dsheet_intl_first_post) = 0
            Cells(i, dsheet_intl_second_post) = 0
            Cells(i, dsheet_max_dispatch_time) = 2
            Cells(i, dsheet_return_accepted) = "ReturnsAccepted"
            Cells(i, dsheet_return_refund) = "MoneyBackOrExchange"
            Cells(i, dsheet_return_within) = "Days_14"
            Cells(i, dsheet_return_shipby) = "Buyer"
            Cells(i, dsheet_return_policy) = "Restocking fees: No"
‘            Cells(i, dsheet_productsize) = ""
‘            Cells(i, dsheet_receivedesc1) = ""
‘            Cells(i, dsheet_receivedesc2) = ""
‘            Cells(i, dsheet_receivedesc3) = ""
‘            Cells(i, dsheet_receivedesc4) = ""
‘            Cells(i, dsheet_receivedesc5) = ""
            Cells(i, dsheet_maindesc01) = basic_description     ‘产品内容文字描述
‘            Cells(i, dsheet_maindesc02) = ""
‘            Cells(i, dsheet_maindesc03) = ""
‘            Cells(i, dsheet_maindesc04) = ""
‘            Cells(i, dsheet_maindesc05) = ""
‘            Cells(i, dsheet_maindesc06) = ""
‘            Cells(i, dsheet_maindesc07) = ""
‘            Cells(i, dsheet_maindesc08) = ""
‘            Cells(i, dsheet_maindesc09) = ""
‘            Cells(i, dsheet_maindesc10) = ""
            Cells(i, dsheet_pictotal) = 0
‘            Cells(i, dsheet_poster) = ""
‘            Cells(i, dsheet_poster_link) = ""
            Cells(i, dsheet_gallery) = basic_photo
            Cells(i, dsheet_gallerytype) = "Gallery"
‘            Cells(i, dsheet_photofirst) = ""
            Cells(i, dsheet_pic_use_actual_path) = 1
            Cells(i, dsheet_desc_use_actual_html) = 0
            Cells(i, dsheet_cmptblty_use_profile) = 0
‘            Cells(i, dsheet_pic_actual_paths) = ""
            Cells(i, dsheet_condition_id) = 1000
‘            Cells(i, dsheet_condition_desc) = ""
            Cells(i, dsheet_ebcategory) = basic_ebay_cat1
            Cells(i, dsheet_ebcategory2) = basic_ebay_cat2
‘            Cells(i, dsheet_shopcategory1) = basic_shop_cat1
‘            Cells(i, dsheet_shopcategory2) = basic_shop_cat2
‘            Cells(i, dsheet_sitecategory) = ""
            Cells(i, dsheet_titleexternal) = Trim(Replace(basic_title, Chr(10), ""))
‘            Cells(i, dsheet_subtitleexternal) = ""
            Cells(i, dsheet_titleinternal) = Trim(Replace(basic_title, Chr(10), ""))
            
            Cells(i, dsheet_item_specific_1) = "Brand:Unbranded"
            Cells(i, dsheet_item_specific_2) = "MPN:Does not apply"
            If basic_ismult <> 1 Then Cells(i, dsheet_item_specific_3) = "UPC:Does not apply"
            Cells(i, dsheet_item_specific_4) = Trim(basic_item_spec4)
            Cells(i, dsheet_item_specific_5) = Trim(basic_item_spec5)
            Cells(i, dsheet_item_specific_6) = Trim(basic_item_spec6)
            Cells(i, dsheet_item_specific_7) = Trim(basic_item_spec7)
            Cells(i, dsheet_item_specific_8) = Trim(basic_item_spec8)
            Cells(i, dsheet_item_specific_9) = Trim(basic_item_spec9)
            Cells(i, dsheet_item_specific_10) = Trim(basic_item_spec10)
            Cells(i, dsheet_item_specific_11) = Trim(basic_item_spec11)
            Cells(i, dsheet_item_specific_12) = Trim(basic_item_spec12)
            Cells(i, dsheet_item_specific_13) = Trim(basic_item_spec13)
            Cells(i, dsheet_item_specific_14) = Trim(basic_item_spec14)
            Cells(i, dsheet_item_specific_15) = Trim(basic_item_spec15)
‘            Cells(i, dsheet_catalog_type) = ""
‘            Cells(i, dsheet_catalog_id) = ""
            Cells(i, dsheet_catalog_use_photo) = 0
            Cells(i, dsheet_catalog_use_specific) = 0
‘            Cells(i, dsheet_profile_idx) = ""
‘            Cells(i, dsheet_cmptblty_profile_idx) = ""
            Cells(i, dsheet_template_idx) = 2362
‘            Cells(i, dsheet_attr_group) = ""
            Cells(i, dsheet_privatelisting) = 1
‘            Cells(i, dsheet_listenhancement) = ""
            Cells(i, dsheet_keep_enabled) = 0
            Cells(i, dsheet_EOF) = 0
            i = j
        
        basic_i = basic_i + 1
    Loop
        
    End With

End Sub





ebay商品基本属性组合成数据表格式,可用上传到系统递交数据

标签:image   exit   count   port   blog   export   second   不能   check   

原文地址:http://www.cnblogs.com/jerrypro/p/6438372.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!