|
本帖最后由 LIUZHU 于 2013-7-4 17:30 编辑
回这个帖子,折腾了一下午,总是提示错误,以下是匹配 代码- Private Sub CommandButton1_Click()
- Dim Arr(), Brr(), i%, j%, r%, k%
-
- With Sheets("西药")
- r = .Range("A" & .Cells.Rows.Count).End(xlUp).Row
- Arr = .Range("A1:M" & r).Value
- End With
-
- r = Range("A" & Cells.Rows.Count).End(xlUp).Row
- Brr = Range("A1:F" & r).Value
-
- For i = 1 To UBound(Brr)
- For j = 1 To UBound(Arr)
- If Brr(i, 1) Like "*" & Arr(j, 10) & "*" Then
- For k = 1 To 5
- Brr(i, k + 1) = Arr(j, k)
- Next
- End If
- Next
- Next
-
- Range("A1:F" & r).Value = Brr
- End Sub
复制代码 |
|