軟體:excel
版本:2007
需求很簡單
比對sheets("設定")的A欄 若有這個值就在比對資料那一欄位旁傳回 "V"
沒有就空格
但是會出現此處需要物件
不知道那邊想錯了...
Dim kx As String
Set sht1 = Sheets("資料")
sht1.Select
lastrow = Range("A1").End(xlDown).Row
col1 = Range("A1").End(xlToRight).Column + 1
With Sheets("設定").Range("A:A")
For i = 3 To lastrow
Set kx = .Find(What:=Range("A" & i).Text, LOOKAT:=xlWhole)
^^會出現此處需要物件
If Not k Is Nothing Then
Cells(i, col1) = "V"
Else
Cells(i, col1) = ""
End If
Next i
End With