Hi
I am getting "Duplicate Declaration" error while running my code. Cant post entire code as its too long but i am pasting the problem line.
Can you please help me?
Please Login or Register to view this content.
Hi
I am getting "Duplicate Declaration" error while running my code. Cant post entire code as its too long but i am pasting the problem line.
Can you please help me?
Please Login or Register to view this content.
This is because a variable is declared twice within the same procedure.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
[QUOTE=royUK;2000513]This is because a variable is declared twice within the same procedure.[/QUOTE
Yes i know that. But what is the solution. i thought filter(1) and filter(2) are different variables.
This is because a variable is declared twice in the same procedure. I also think the way you have declared the variables fc(1), etc Excel is expecting an array because only the last one is recognised as a string.
You need to declare them like this
For an alternative way of doing multiple autofilters take a look herePlease Login or Register to view this content.
Can you attach the workbook?
You dimension the array by specifying the bounds.
So rather than 8 mentions use
Please Login or Register to view this content.
Your data in the sheet does not have a header row, so it won't autofilter correctly anyway.
Well as i mentioned earlier this is not original code and original workbook and so there may be little things like that. but the problem is with the error which is correctly reproduced in my sample file.
The header row does not have anything to do with the duplication error. Even after putting a header row it gives the same error.
Do you have any other ideas?
Thanks a lot
J
xyz123,
Please read forum rules below and then add the link to the other excel forum as cross posting without the link is not permitted
VBA Noob
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Hello xyz123,
Andy was correct about you needing to create an Array. Unfortunately, that was only the beginning. You had several other errors as well. I have corrected your macro and added it to the attached workbook. Here is the corrected macro code...
Sincerely,Please Login or Register to view this content.
Leith Ross
Thread closed for not following my request
PM me if you agree to the rules
VBA Noob
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks