Sub demo()
Name = [INDEX(2:2,MATCH("商品名称",1:1,))]
qty = [INDEX(2:2,MATCH("数量",1:1,))]
Item = [INDEX(2:2,MATCH("规格",1:1,))]
Debug.Print Name
Debug.Print qty
Debug.Print Item
End Sub
Sub test()
Dim rng As Range, arr(), n As Byte
For Each rng In Range("1:1")
If Len(rng.Text) > 0 And InStr("商品名称数量规格", rng.Text) > 0 Then
n = n + 1
ReDim Preserve arr(1 To n)
arr(n) = rng.Column
End If
Next
End Sub