我如何使以下语法起作用(单元格(“$variable”,“Q”))?
Sub omnama()
ActiveSheet.Range(Cells("$1", "$A"), Cells("$39930", "$Q"))._
RemoveDuplicates Columns:=Array(1, 2, 6, 7, 8, 9), Header:=xlYes
End Sub
这是删除我看到的重复项的代码,我的问题是, 我想给出一个变量而不是数字
cells("$39930","$Q") should be replaced with the below code
cells("$variable"),"$Q")) but gives the error Type mismatch -- run time error 13
我该如何让它工作? 如果我说
cells($variable,"$Q") ' says that invalid character
那么我如何为上面的代码添加一个变量值。请让我知道。提前谢谢您
Sub omnama()
ActiveSheet.Range(Cells("$1", "$A"), Cells("$39930", "$Q"))._
RemoveDuplicates Columns:=Array(1, 2, 6, 7, 8, 9), Header:=xlYes
End Sub
This is the code to remove the duplicates I have seen and my question is,
I wanna give a variable rather Than a number
cells("$39930","$Q") should be replaced with the below code
cells("$variable"),"$Q")) but gives the error Type mismatch -- run time error 13
How do I make it work?
If i say
cells($variable,"$Q") ' says that invalid character
So how do i put a variable Value for these above code. Please let me know.Thank you in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试这样的事情:
Try something like this: