Dynamic Filters in Excel - excel

I'm using Office 2013, and working on a worksheet in Excel.
My question is, is there a way to create a dynamic filter in Excel?
To explain in more detail, I have a dynamic worksheet, where upon opening the user will get a few drop-down options. After the user has selected one option from each of the drop-downs, the worksheet will display a table of data based on the user's inputs. The user can change their selections from the drop-downs after the table has been displayed, and can also clear their selections. If they clear their selection, the table will disappear.
Now, the first column in the result Table will contain Text values, but can also contain blanks. These values or blanks are all decided based on the user's selections in the previously mentioned drop-downs, which are displayed permanently to the left of the table. I want to add a filter to this first column of the result table (and to the rest of the table with it) such that only the non blank cells are displayed in the table every time the drop-downs are changed.

As I understand your need correct, I can give you this solution:
For getting a better result make your range to Table.
Select Power View from Insert items;
A sheet Power View 1 will added to your workbook;
From right pane select Table1 and its fields;
From Filter pane select as you want for filtering.

Related

How to filter out multiple values assigned to a specific name in my filer column?

I need to create an Excel template with f.e following columns and data:
Example of an Excel Table
and so on. So my goal is to set up the filter in such a way, that when I choose A1 from A column, I can get all the related B,C and D values, like B1,C1,D1; B1.1,C1.1,D1.1;B1.2,C1.2,D1.2
With the normal filter I can only see B1,C1,D1 when I choose A1.
The only solution I came up with, is writing A1 in every row that has relevant B 1.x ,C 1.x and D 1,x. Then I can see all relevant stuff, but this solution is not the most effective one(especially when values inserted will be a small text, writing same sentences in each row makes it look a bit messy)
The Pivot Table also does not recognize B1.1 C1.1,D1.1; B1.2 C1.2,D1.2 as related to A1. Even when I copied A1 in every row, it still couldn't sort it correctly.
Can you please help me with these quesitons? Many thanks in advance!
Kamola.
Update: I created a following example for clarification, hope it will help a bit! Unfortunately I cannot share the Excel Sheet per Stack Overflow, so here is a screenshot of it:Example of the content
MANUAL APPROACH
In your example which is a Table but not a pivot table,
Highlight Column Problems in your table;
Press Ctrl+G on your keyboard to bring out the Go To window;
Click Special... button at the left corner of the window;
Select Blanks then click OK;
Do not alter anything, go to the formula bar and enter =A2, then hold Ctrl key and press Enter.
If you have done the above steps correctly, you should have column A filled with Problem IDs.
POWER QUERY APPROACH
FYI, if you are using Excel 2010 Professional Plus or later versions of Excel, you can add your data table to Power Query Editor, right click the column header of the first column and select Fill -> Down to quickly fill the column with all Problem ID.
PIVOT TABLE APPROACH
If you want to show row labels in each line in a pivot table (as mentioned in your post), click somewhere within the pivot table, go to Design tab in the Excel ribbon, click Report Layout and select Repeat All Item Labels.
Let me know if you have any questions. Cheers :)

Insert Table header Row when column value changes

I have a table of overdue customer invoices. Each customer could have several overdue invoices and I want to collate these into separate customer tables, with a sum total of due amount.
I want this to be in one worksheet, with the header row above each customer table.
Therefore, I'm looking for a VBA macro that will go through the data in column A and when it sees a change, from one customer number to the next, it totals up the values for that customer and inserts the header row, ready for the next customer. And continues on...
Example sheet Here
Sheet(tab)1 shows raw data, sheet2 shows how the formatted data should look.
I'm stumped sorry and any help or direction appreciated. Hope the info is clear.
To get started I suggest you search google "creating vba macros read and write column"
Are you familiar with VBA macro? If not, you could use a combination of index, and match formula.
Otherwise VBA solution logic, in VBA editor - which is accessible by Alt +F11:
Click on the sheet you want your VBA code to apply to and start writing your function. For example a function to check a cell range called "myFunction" would be as follows,
A single example:
Sub myFunction ()
If range.("A1").value = "Customer1" then
Range("B1:E1").Insert([Shift], [CopyOrigin])
end If
Sub End
More work required to check condition on event, dynamic insert, and will need to be wrapped in a loop. The below are tutorials specific to the job you need to program your macro for.
VBA copy and paste code if condition is met tutorial here : https://youtu.be/qGZQIl9JJk4
VBA insert tutorial here : https://powerspreadsheets.com/excel-vba-insert-row/#Excel-VBA-Constructs-to-Insert-Rows
VBA How to SUM Totals At Bottom of a Column Dynamically : https://youtu.be/_0Vcnb3xdOM
The first question is-- What VBA have you tried?
Next, change col A heading to Customer, and col E heading to Amount
because these are the desired output headings .
Next, did you know that by dropping down View, and then Macros,
that there is a RECORD button? Click it.
Finally, it records your pressing Insert / PivotTable on a New sheet.
Drag the Amount field down to the Values box
After you drag each of the other fields to the Rows box,
left click on it in the Rows box, and select FieldSettings --
Subtotals tab -- Automatic for Customer, None for the others
Layout tab -- Show item labels in tabular form for each field
and just for Customer field--Insert page break after each item
At the end, click on any cell of the pivot, select PivotTableOptions --
Totals&Filters tab -- unclick Column totals
Click PageLayout,
then Margins -- make them narrow
then Sheet -- Rows to print at the top
Maybe Header -- Custom Header
Finally click on View / Macro
StopRecording
Presto, now the VBA has been captured.
Ok, so all you have to do is insert a Subtotal. Check out these screen shots.
Before:
After:
Depending on which version of Excel you are using, would probably determine how to navigate to the Subtotal button. Google for that, if you can't fine it. Should be super-simple.

ms excel - data validation for 2 drop down list

I'm looking for the solution in excel data validation for 2 drop down list.
When I choose 1st drop down list 2nd drop down list will auto populate the correct value from table. If user choose 2nd drop down list 1st drop down list will auto populate the value also.
Can someone help me on this issue ?
I attach the sample file for my problem.
enter image description here
enter image description here
thanks!
Sample File
Trying to do a two way I don't think is going to work in the way you are trying so I am not surprised the examples you found were for one-way. I am open to being corrected.
You could hack around it for example using two form control listboxes linked to the same cell so a selection in one updates the other.
Then because an item might be out of view listbox underneath have two cells which use the linked cell to index back into the source lists.
In the example above, there are two list boxes from form controls in developer tab (customize ribbon > add developer tab.
Developer tab form control - 2nd from the right
You add two of these in to the sheet.
Right click format control on each one
Set the input range to the range containing your list of values for that listbox and set the linked cell e.g. G1
Ensure that whilst you select different input ranges for each list box, they should have the same linked cell e.g. G1.
Underneath the listboxes put a formula which uses the linked cell G1 to index back into the source lists for each listbox so you can retrieve the selected value and have it visible, in case not visible within listbox.
Example testing:

Check for duplicate value among 10 combox boxes when summit excel vba

I have 10 comboboxes on my userform that share 10 same selections, and I would like to check for duplicated value before summit.
As far as I can imagine, there are two ways to get the result, the first one is to check for same value among these ten boxes when summit by using message box OR to hide the selections from other comboboxes once the option is being selected by any one of the boxes.
Since I am new to vba, I am having a hard to grasp this idea in to code, please help.Userform with 10 comboboxes that share the same selections
I think your second idea is the best, because it prevents the unwanted behavior instead of correcting it.
You can either build a responsive sql which filters out the already selected values, or you could create 10 queries, one for each combobox.
Start by creating a table with values you want to have for your selection.
Make a query like this: (Combobox1) SELECT value FROM Table;
This is the input query for your first combobox.
Create a second query (Combobox2) based on the first query. SELECT value FROM Query1 WHERE value <> Forms!formname!Combobox1
This will be the input query for your second combobox.
Now create a third query based on the second like: SELECT value FROM Query2 WHERE value <> Forms!formname!Combobox2; Which will be the input for your third combobox.
Keep on doing this untill you have a query for each combobox.

need to display a drop down menu in the userform in VBA. The data to be displayed is stored in a table in a sheet

I have a table, stored in a worksheet. I need to display the data of this table (only the first column) in a listbox in a User-form. Can anyone suggest me a way to do it ??? Thanks in advance . :)
Focused on your combo box in the form designer by clicking on it, then look for a property in the properties explorer named 'row source'. Supply an appropriate cell range , e.g. Sheet2!A1:A20, or A:A for the entire A column, ....

Resources