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
Try something like this: