作者napyang (愛唱歌的大男孩)
看板Visual_Basic
標題Re: [VBA ] 逐列判斷重複
時間Fri Nov 8 22:01:50 2019
簡單建議你這樣寫
Dim startRange as range
Set startRange = range(“A1”)
Do while startRange.value <> “”
For i = 0 to 4
if application.countif(Range(startRange,startRange.offset(0,4)),startRange.o
ffset(0,i))=2 then
startRange.offset(0,5)=startRange.offset(0,i).value
End if
Next i
set startRange = startRange.offset(1,0)
Loop
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 59.125.98.209 (臺灣)
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Visual_Basic/M.1573221712.A.264.html
1F:推 ShakingMilk: 原來要讓countif橫向可以這樣寫!再用offset下移 11/08 23:08
2F:→ ShakingMilk: 學到了 感謝!! 11/08 23:08
3F:→ napyang: You’re welcome:) 11/09 12:30