macro button to filter out list

phoj69

New Member
Joined
Sep 22, 2014
Messages
4
I have a report that has thousands of lines and each part # on that line has a specific stocking location. Now there are certain locations that I want to see and certain ones that I want to filter out. Is there a macro that I can set up so I set up a button and it filters out from the list? So if a had seperate lines that had locations a, b, c, d, e, f, g, h and I had another file that had locations g and h on it, it would filter out those. But this would be thosuands of lines so I need a way to look at that entire list
 

Some videos you may like

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

ChrisBM

Board Regular
Joined
Sep 22, 2014
Messages
215
You are potentially better off just filtering the data? That way you can quickly and easily get to the data you are interested in.

Just apply a filter to the header row and select 'g and h' in the locations filter.

----------------------------------
If you want a macro to do it you can do it with using a For loop to loop through each row, check value in locations column and see whether it exists in the ones you are looking for, then hiding the row. Let me know if you need help with this.

Kind Regards,
Chris
 

phoj69

New Member
Joined
Sep 22, 2014
Messages
4
The problem I have is the # of locations I need to filter out is over 200 different locations. Someone from this board helped me set up a filter to get rid of those fields but I was hoping to set up a button that the person could just click and it would filter out all of those locations.


You are potentially better off just filtering the data? That way you can quickly and easily get to the data you are interested in.

Just apply a filter to the header row and select 'g and h' in the locations filter.

----------------------------------
If you want a macro to do it you can do it with using a For loop to loop through each row, check value in locations column and see whether it exists in the ones you are looking for, then hiding the row. Let me know if you need help with this.

Kind Regards,
Chris
 

Watch MrExcel Video

Forum statistics

Threads
1,108,986
Messages
5,526,065
Members
409,685
Latest member
Davetom

This Week's Hot Topics

Top