VBA to filter the data based on cell values NOT within the dataset

Sundqvist

New Member
Joined
Aug 23, 2016
Messages
1
Hello everyone,

I'm a new comer, very nice to be here. :) I'm totally new to VBA codes and macros (just watched some videos tutorials and online discussions today), and couldn't think of any solutions for what I want to do, so hope some of you could help.

I'm using MS Office Excel 2013, and my operating system is Windows 7. I created a gantt chart (Bar chart) with a list of tasks, containing task name, start date, deadline, duration, and remaining days. Duration and remaining days of the tasks are calculated automatically using functions. I don't like the cells with words "completed/incompleted", so I used conditional formatting to mark a task completed (double click the cell besides a task (done column) to show a smiling face and the task row is filled with green background with the fonts strikethrough; if the current day is over the deadline but the cell besides the task (done column) is still empty, then show a sad face, and the task row is filled with red background). I can't show the background colors in the table below but you get what I mean. ;)

Done
Tasks
Start date
Deadline
Duration
Remaining
Task121.08.201631.08.2016118
:(Task211.08.201620.08.201610-3

<tbody>
</tbody>


Now I want to use a Combo Box to filter the tasks (I very dislike the Excel build-in filter function, I would like a separate dropdown filter from the tasks table), but with some fixed options which are NOT found from the dataset. I want the Combo Box to have 4 options: All, Completed, Incompleted, Overdue tasks. Surely it's possible to use conditional formatting to show in another column whether the task is completed or not, but then the options in the dropdown menu would be based on the completion column, if there is no task completed, there won't be such an option in the dropdown filter as "completed"; the same goes for "All" and "Overdue". I would need the result that even when there's no task completed or overdue, there are still the option "completed", "overdue" (and of course also "all"), and when clicking on these option, there's nothing to show except for the titles (tasks, start date,...), all the tasks are filtered out (hidden also with the bar chart). Are there such codes which could solve this?

I have searched for possible solutions which apply dependent combo box selections to a filter, where the original data is within 1 worksheet and the filtered data is in another worksheet (of course the combo box selections are still dependent on the cells values and thus not useful for me). But I would like not to use multiple worksheets and rather hope to realize it in 1 worksheet. Is it possible? I haven't found any feasible solutions for my problem (not even similar problems) and I don't have any idea of using the codes, so I haven't tried any codes.

Hope it is clear for you to understand the problem. Thanks a lot in advance and apologize for the long text. :)
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,216,113
Messages
6,128,904
Members
449,477
Latest member
panjongshing

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