試試看
Sub sech()
Dim i As Integer, j As Integer, Rng
Dim Nam As String
For i = 2 To 6
Nam = Sheets(3).Cells(i, "a")
Sheets(2).Select
Set Rng = Range("A:A").Find(What:=Nam, LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=True, MatchByte:=False, SearchFormat _
:=False)
Sheets(3).Cells(i, "b") = Rng.Offset(, 1)
'無法切換問題
Sheets(1).Select
Set Rng = Range("B:B").Find(What:=Nam, LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=True, MatchByte:=False, SearchFormat _
:=False)
Sheets(3).Cells(i, "c") = Rng.Offset(, -1)
Next i
End Sub作者: lionliu 時間: 2017-4-15 23:06