VBA Apply autofilter for non contiguous dynamic ranges?

Melimob

Active Member
Joined
Oct 16, 2011
Messages
396
Office Version
  1. 365
Hi

I've inherited a 'badly formatted' document which they need to be able to filter on.

Since the document has to remain in it's current state, I can't 'clean' using Get & Transform nor can I convert to a table ...both of which I would love to have done.

Is there any way I can use VBA to add a filter so it looks from the bottom up to define last row (as this will change if they delete/insert rows) and apply to certain columns.

Data set out like this:

Row 8 is where filter should apply.
Row 15 is where data starts from but under each section there again may be blank rows hence I need to define last row on xlup from bottom I think.

Starting column B
B = merged cell (yuk)
C = Countries but then underneath a client count and blank cells again. I would only want to filter the whole country group. I.e. all the rows which are under that country.
D = Client name - may want to filter these and include the country
E = Sales Name - again I may want to filter this but with a view of what countries they are against

I'm not sure this is possible. I may have to give up and have a seperate page for them to analyse this but if there is a way to add a filter to such a sheet I'd be grateful to try.

Many thanks
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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