
我正在組合兩列並使用 find 方法。我正在使用一個工作表和另一個範圍,但是當我使用範圍時,我的程式碼不起作用。我收到錯誤。這是下面的程式碼。我收到類型不匹配錯誤。
Do While ws1.Cells(count, 1).Value <> ""
Set comparisonCell = ws2.Range("D:D") & "" & ws2.Range("C:C").Find(What:=ws1.Cells(count, 4) & "" & ws1.Cells(count, 3))
If Not comparisonCell Is Nothing Then
ws1.Cells(count, 6) = comparisonCell.Offset(0, 2)
count = count + 1
Else: ws1.Cells(count, 6) = "New"
count = count + 1
End If
Loop