I am using Advance Filter to pull data from one file [File name:AVGUSAGE.xls Sheet Name:AVGUSAGE] to another file[FilterMacro.xls].
I recorded the Marco for the advance filter. The code of that Macro is as follow:
The Macro runs fine as long as the sheet AVGUSAGE (from which I am pulling the data) is opened. When the sheet is closed the macro gives an error.Please Login or Register to view this content.
I know I need to open that Sheet in Marco VB code. I am not at all familiar with VB but I somehow got to know how to open the file before program run and close it after it.
After adding the open file code, my MARCO code looks like:
Please Login or Register to view this content.
When I run my macro now it gives me an error:
Run-time error ‘1004’: The exact range has a missing or illegal field name.
Being a total stranger to VB, I have no idea where have I gone wrong.
Do I have to declare workbook and worksheets and then use variables?
Kindly help! My sheet can be downloaded from:
http://rapidshare.com/files/410985318/AVGUSAGE.zip
Bookmarks