Dim i, j, rcnt As Integer
Dim x As Variant
Sheets("B").Select
rcnt = Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To rcnt
x = 1
Do While x <= Sheets("a").Range("a1").CurrentRegion.Rows.Count
If Sheets("a").Cells(x, 1) = Sheets("B").Cells(i, 1) And IsNumberic(Cells(i, 3).Value) Then
Cells(i, 2) = Sheets("A").Cells(x, 2)
Cells(i, 2).Offset(1) = Sheets("A").Cells(x, 2).Offset(1)
End If
x = x + 1
Loop
Next
Set x = Nothing
End Sub
Function IsNumberic(Value As String) As Boolean
If Value Like "[+-]*" Then Value = Mid$(Value, 2)
IsNumberic = Not Value Like "*[!0-9.]*" And Not Value Like "*.*.*" And _
Len(Value) > 0 And Value <> "."
End Function作者: GBKEE 時間: 2015-5-28 15:06