系统提示定义或应用对象错误,但是我真的找不出错在哪里了。求解答。(刚学10天)
Public Sub 测试()Dim i(1 To 11) As String, y As Byte, x As Byte, z As Variant, sz As Variant, m As Byte
i(1) = "*SKU"
i(2) = "*品名"
i(3) = "销售状态"
i(4) = "分类"
i(5) = "品牌"
i(6) = "型号"
i(7) = "开发人"
i(8) = "采购成本(CNY)"
i(9) = "供应商名称"
i(10) = "首选供应商"
i(11) = "供应商采购单价(CNY)"
y = 1
z = Range("a2").CurrentRegion.Rows.Count
Do While y <= 33
For x = 1 To 11 Step 1
If Cells(y).Value Like i(x) Then
sz = Range(Cells(2, y), Cells(z, y)).Value
For m = 1 To 33 Step 1
If Workbooks("product.xlsx").Worksheets(1).Cells(m).Value Like i(x) Then
Workbooks("product.xlsx").Worksheets(1).Range(Cells(2, y), Cells(z, y)).Value = sz
End If
Next m
End If
Next x
x = 1
y = y + 1
Loop
End Sub