July 29, 2013
July 29, 2013
Hi Phil. Sorry for the delayed reply, I was stuck in meetings (UGH) the last few days.
Here's the file. Here's the line of code that's giving me issues. Instead of the number 200, I want to use the variable "email" there as I will never know each time I run this report whether I'll have 100 rows of data or 5,000 rows.
Range(Cells(1, 1), Cells(200, finalcol)).RemoveDuplicates Columns:=Array(email, courseyear), Header:=xlYes
PS No laughing at my code please. I'm sure it leaves a lot to be desired. 🙂
October 5, 2010
That said, the Columns array you supply to RemoveDuplicates is a list of the column numbers that contain duplicates
https://docs.microsoft.com/en-.....Duplicates
so if email is 200 then Excel is trying to remove duplicates from column GR. Is that what you are intending to do?
Regards
Phil
October 5, 2010
Hi Bob,
I don't think you are using RemoveDuplicates correctly- did you read the link i posted?
RemoveDuplicates removes duplicates from a range, it doesn't compare two ranges and remove one of them.
Please attach your file so I can see what it is you are trying to do.
Regards
Phil
1 Guest(s)