RemoveDuplicates gives 1004 error

半世苍凉 提交于 2019-12-01 05:35:42

问题


I want to remove duplicates from my selection, but this line gives me a 1004 error:

ActiveSheet.Range("B3", Range("B3").End(xlDown)).RemoveDuplicates Columns:=2, Header:=xlNo

How do I fix this?


回答1:


Change your line into:

ActiveSheet.Range(range("B3"), Range("B3").End(xlDown)).RemoveDuplicates Columns:=1, Header:=xlNo

or,if you really have 2 columns into:

ActiveSheet.Range(range("B3"), Range("C3").End(xlDown)).RemoveDuplicates Columns:=2, Header:=xlNo


来源:https://stackoverflow.com/questions/15929896/removeduplicates-gives-1004-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!