Morning,
Is it possible to write code so that it filters data specifically on what the user wants to filter by.
For example.
If the user specified filter by column 19, GBP?
Morning,
Is it possible to write code so that it filters data specifically on what the user wants to filter by.
For example.
If the user specified filter by column 19, GBP?
Last edited by kenadams378; 08-30-2012 at 07:05 AM.
How would the user be specifying the criteria?
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
by entering a column number and then criteria
For example
column = 19
criteria = GBP.
Where would the criteria be specified?
It is possible. You may read this page to get the idea:http://www.worldbestlearningcenter.c...ta-example.htm
On a front sheet called 'start'
Cell A1, A2
Try this
![]()
Please Login or Register to view this content.
Thanks Arlu,
The following code
Can you check if this is okay, i get an error message to say subscript out of range![]()
Please Login or Register to view this content.
Subscript out of range has everything to do with the sheet names.
Just check that your sheet names are named properly and matching with the code in terms of case and spelling.
checked and names are okay, the only thing i can think of is that does it need to be Auto Filter Column rather than field?!
No the syntax says field.
You can try recording the code with some temp fields and then change them accordingly to your start sheet fields.
Still not working, i have attached the workbook here, can you have a look for me, the filter is applied as part of step 1?
Have you been able to look at my attachment Arlu?
In the following line of code i have the error 'object required'
Any ideas on what the issue is;
![]()
Please Login or Register to view this content.
What is the code before that line?
![]()
Please Login or Register to view this content.
What is wb declared as in the dim statements?![]()
Please Login or Register to view this content.
It is declared as Workbook?
Dim wb As Workbook
Can you post your whole code here? It needs a lil change.
![]()
Please Login or Register to view this content.
Try this
![]()
Please Login or Register to view this content.
Thanks but i have an error on the same line
Subscript out of range
The only sheet this effects is the start sheet and that is named the same as the macro
Is it this line that is affected? -Does your file have a Sheet1? The file that you are opening through the macro?![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks