d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help With An Advanced Excel Formula. > I Hope This Is The Right Place
Prev12
Add Reply New Topic New Poll
Member
Posts: 13,657
Joined: Jun 17 2009
Gold: 31,123.00
Mar 3 2019 05:11pm
Quote (Orv @ Mar 3 2019 05:55pm)
I'm back to this project.

Is it possible to auto filter based on the value of another cell? H4 and J4 are selected via another sheet. I would like to be able to filter the data based on these selections.

https://i.imgur.com/ToY559R.png




What I would like to do now is, if H4 and J4 are filtered, I would like to be able to display the top 10 possibilities of Column D, sorted an a descending order


The only way I think this is possible is through VBA or an extension. I did some quick googling and came across the below link which has some VBA code that seems to do the trick, but I haven't ever done anything like this before.

https://www.extendoffice.com/documents/excel/3656-excel-autofilter-based-on-cell-value.html

VBA is basically a programming language that allows you to create macros or automate things within excel. First you would need to allow the Developer ribbon within Excel. This link below should walk you through how to do that.

https://www.techonthenet.com/excel/questions/developer_tab2013.php

I would then use the insert button on the developer ribbon to add a button somewhere on your sheet, maybe just below the cells you want to filter by. I think you then right click the button and click either properties or assign macro (I don't have Excel installed on this computer, so working off memory haha) and then when you are assigning the macro there is a button for "New Macro" which will open up a new page similar to the screenshot in the first link where you can paste that VBA code in (remember to change the cell references).

Then essentially it will run that code and filter the results every time you press the button that you assigned that Macro to.

I don't have a great deal of experience with VBA, but know some of the general basics if you get stuck.
Member
Posts: 11,752
Joined: Aug 17 2005
Gold: 9,727.00
Mar 3 2019 05:25pm
Quote (Huggy8o4 @ Mar 3 2019 05:11pm)
The only way I think this is possible is through VBA or an extension. I did some quick googling and came across the below link which has some VBA code that seems to do the trick, but I haven't ever done anything like this before.

https://www.extendoffice.com/documents/excel/3656-excel-autofilter-based-on-cell-value.html

VBA is basically a programming language that allows you to create macros or automate things within excel. First you would need to allow the Developer ribbon within Excel. This link below should walk you through how to do that.

https://www.techonthenet.com/excel/questions/developer_tab2013.php

I would then use the insert button on the developer ribbon to add a button somewhere on your sheet, maybe just below the cells you want to filter by. I think you then right click the button and click either properties or assign macro (I don't have Excel installed on this computer, so working off memory haha) and then when you are assigning the macro there is a button for "New Macro" which will open up a new page similar to the screenshot in the first link where you can paste that VBA code in (remember to change the cell references).

Then essentially it will run that code and filter the results every time you press the button that you assigned that Macro to.

I don't have a great deal of experience with VBA, but know some of the general basics if you get stuck.


I actually tried the first link. The problem is, it requires you to enter data in that cell to execute the code. I'm using "Openasapp" to make a cell phone app to find this data on the fly. Its been difficult lol
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll