0
尋找Vlookup直到最後一行。有沒有辦法做到不給範圍?它可以做到最後一排。在VBA中沒有範圍的Vlookup
Do While IsEmpty(Cells(i, Name)) = False
Str = Cells(i, Name)
ws2.Select
On Error Resume Next
Corp = Application.WorksheetFunction.VLookup(Str, ws2.Range("G2:S3000"), 4, False)
result = Application.WorksheetFunction.VLookup(Str, ws2.Range("G2:S3000"), 13, False)
'Band = Application.WorksheetFunction.VLookup(Str, ws2.Range("G2:S2500"), 7, False)
If (Err <> 0) Then
Else
ws1.Select
If (result <> 0) Then
Cells(i, 10) = result
End If
Cells(i, 9) = Corp
End If
i = i + 1
ws1.Select
Loop
End Sub
修改了範圍(G2 「)。它不工作 – Butterfly
上的錯誤繼續下一步 公司= Application.WorksheetFunction.VLookup(力量,ws2.Range(」 G2" ) ,4,False) result = Application.WorksheetFunction.VLookup(Str,ws2.Range(「G2」),13,False) – Butterfly
想要得到一個答案嗎?有沒有辦法看到這一行的結束代碼 – Butterfly