求助:之前运行没有问题,后来重装系统重装office就报错:应用程序定义或对象定义错误1004

qq_28936957 2019-08-30 10:05:55
是一个调用Excel删除重复值功能批量删除多列每一列的重复值的VBA代码

Sub Macro1()
Dim i, j
For i = 1 To [a1].End(xlToRight).Column
ActiveSheet.Range(Cells(1, i), Cells(Cells(1048576, i).End(xlUp).Row, i)).RemoveDuplicates Columns:=1, Header:=xlNo
Next
End Sub

...全文
271 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
米老鼠yeah 2019-09-17
  • 打赏
  • 举报
回复
大哥,没错呀,是不是你没有给工作表里放数据啊
米老鼠yeah 2019-09-17
  • 打赏
  • 举报
回复
Sub Macro1()
        Dim i, j
        
        For i = 1 To [a1].End(xlToRight).Column
                ActiveSheet.Range(Cells(1, i), Cells(ActiveSheet.Cells(1048576, i).End(xlUp).Row, i)).RemoveDuplicates Columns:=1, Header:=xlNo
        Next
End Sub
Cells(ActiveSheet.Cells(1048576, i).End(xlUp).Row, i)
米老鼠yeah 2019-09-17
  • 打赏
  • 举报
回复
Sub Macro1()
        Dim i, j
        
        For i = 1 To [a1].End(xlToRight).Column
                ActiveSheet.Range(Cells(1, i), Cells(ActiveSheet.Cells(1048576, i).End(xlUp).Row, i)).RemoveDuplicates Columns:=1, Header:=xlNo
        Next
End Sub

2,503

社区成员

发帖
与我相关
我的任务
社区描述
VBA(Visual Basic for Applications)是Visual Basic的一种宏语言,是在其桌面应用程序中执行通用的自动化(OLE)任务的编程语言。
社区管理员
  • VBA
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧