0
有問題,在我的Excel 2010中VBA使用VLOOKUP我Excel 2010中VBA,與VLOOKUP循環
我想遍歷一個空白列每個單元,並從相鄰列從數據查找值資源。我想在循環中做到這一點。我曾在很多論壇上看過,並可以正確使用它。
繼承人我的代碼
Sheets("NPT(hrs)").Activate
Dim NumberRows As Integer
NumberRows = Range("a:a").Find("*", Range("A1"), SearchDirection:=xlPrevious).Row
NumberRows = NumberRows
ActiveCell.Offset(2, 69).Activate
For RowNum = 1 To NumberRows
If Len(Range("BQ1").Offset(RowNum, 0)) = 0 Then
ActiveCell.Value = Application.WorksheetFunction.VLookup(Cells(RowNum, 68), "Equipment!A:K", 7, False)
ActiveCell.Offset(1, 0).Activate
'' This approach never workedXXX
'v = WorksheetFunction.VLookup(Cells(RowNum, 68), "Equipment!A:K", 7, False)
' ActiveSheet.Cells(RowNum , 69).Formula = "=VLOOKUP(Cells(RowNum,68) ,Equipment!A:K,7,false)"
'ActiveCell.Text = "v"
'MsgBox "fin work?"
End If
謝謝,我嘗試過了,但我的範圍數據要查找的另一個頁面上,這似乎與這個問題 – schnarr