作者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/cn.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