大家好~
我想請問的是在VBA中,如果使用Application.WorksheetFunction.CountIf
我想在sheet1的A欄中逐一比對sheet2的A欄中是否已出現
個人寫的Code如下
Dim myrange As Range
w = 2
Do While Sheet1.Cells(w, "A") <> Empty
ww = Sheet1.Cells(w, "A")
Set myrange = Worksheets(2).Range("A:A")
yy = Application.WorksheetFunction.CountIf(myrange, ww)
If yy <> 0 Then Exit Do
....
w = w + 1
Loop
ww是商品代碼,問題出在COUNTIF第二個引數似乎在用變數寫入時用法不對…
麻煩各位先進指點一二~感謝作者: Min 時間: 2010-8-13 23:14