6,210
社区成员
发帖
与我相关
我的任务
分享
R S 列是需要的结果
求大神帮忙写个公式,找出工单对应的订单
Sub pickup()
Dim a() As String, b() As String
Dim value As String, row As Integer, index As Integer
row = 0: index = -1
For i = 1 To Sheet1.UsedRange.Rows.Count
value = Cells(i, 2)
If value <> "" Then
index = index + 1
ReDim Preserve b(index) As String
b(index) = value
End If
If Cells(i, 1) <> "" Then row = row + 1
Next
For i = 1 To row
value = Cells(i, 1)
For j = 0 To index
If InStr(value, b(j)) > 0 Then
Cells(i, 3) = b(j)
Exit For
End If
Next
Next
End Sub