Filtering Excel Data with VBA

mosslovell

New Member
Joined
Oct 5, 2014
Messages
4
Hi All,

I have been searching the internet to solve my little problem.

I have some data and I would like to filter in place unique data to show unique values only.

I dont want to copy the data to another sheet as i will be using the filtered data to filter it down some more.

So for example

NameLastPlace
AnnAWolves
AnnbBham
BettyaWolves
CarolaBham
CarolbWolves
AnnAWolves
CarolaBham

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>
So I need to filter on Wolves and show only the unique names.

Thanks in advance guys.

Moss
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
If you research advanced filters, I think those will manage what you are looking for. In your example though, you would have to enter "Place" and "Wolves" into 2 cells of your sheet first, then use that for the criteria range argument of the advanced filter. I would try out the advanced filter through the Ribbon GUI first to see how it works before messing with the VBA.
 
Upvote 0
If you research advanced filters, I think those will manage what you are looking for. In your example though, you would have to enter "Place" and "Wolves" into 2 cells of your sheet first, then use that for the criteria range argument of the advanced filter. I would try out the advanced filter through the Ribbon GUI first to see how it works before messing with the VBA.

Thanks for your reply Odin.

I think you have misunderstood me.

When you do an advanced filter you can have the results displayed on the same page(inplace) which only shows the results or have the results copied to another sheet.

I have tried mixing normal filter and advanced filter but some object error shows.

The data also has other columns, which I guess play a part in the rows being unique or not.

So i need to filter data based on the selection then show only the unique values where the values to use are in the first 3 columns only.

Cheers all that have the knowledge.

Moss
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,150
Members
448,552
Latest member
WORKINGWITHNOLEADER

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top