Excel : Input and Retrieve Data using Textbox - excel

I have a listBox with different countries name, when a country is selected information related to this country will show up in a textbox. I did that using a simple VLOOKUP for a table containing the countries and comments columns.
=VLOOKUP(INDEX(countries,$C$10),countriestable,2,FALSE)
Now let's say I would like to add a Second TextBox, which will have a reverse action, user will input data/Comments in the textbox and this will be saved in the countriestable accordingly (As per country selected )
The problem is I could link the texbox2 to a cell and add the same formula as textbox1, but then when I input data, it will overwrite the linked-cell formula, then when I change countrie from the listbox, the values in Textbox2 logically will noo change ( static ).
How can I achieve a way where ( On same page ) I have a texbox to display data from the table ( Step1 is succesfull ) and a Texbox in which a user can write/input comment data ?
Thanks for any guidance,
Regards
Excel version 2007

You need to decide if and when you want to transfer the comment of textbox2 into countriestable. As countriestable is a kind of "master table" I wouldn't recommend to go for formulas in it trying to pull comments across from the user sheet ... master tables should not contain formulas ... too elusive
Instead I would make the textbox2 field without any link to any specific Excel cell, but instead add a button which the user can press to transfer his/her comment into the countriestable. I also would maybe consider an additional column in countriestable for "user-comment" (as opposed to "generic-comment" which you retrieve upon entering/selecting the country). Lastly I could think of making 2 buttons instead of 1, with the functions "Add to user comment" / "Replace user comment"

Related

How to display custom text as a label in an excel cell for a particular column?

I want to create a custom template for users with data validations. I have completed the data validation part but I want to display all the cell values in a certain columns as dropdown values with a label like "Select from dropdown".
Once you applied the List, you can add the Text "Select from dropdown" by copy and paste (as value) to the list cells.
Then you have it as you want, but once you choose a value from the drop down and delete it again, then the cell will remain empty. The text "Select from dropdown" will not display anymore. Solving this, you will need to use VBA programming.

Want to transfer information from a listbox that into separate rows in the main table

I have created a form with a text box (date), combobox (course), combobox (name of attendee).
The name combobox feeds into a list box, so that all the people who attended the course are able to be captured. The listbox is editable incase the wrong name was selected.
Now I want a button to save all the details.
So for the each person who attended the course, the date, person's name and course name will be captured in a separate line in the table.
But when I try to extract the data from the listbox to the cell it states is a type mismatch.
How can I enter ALL the information into the table?
I have a loop for 0 to listcount
I am entering the value into .Range("A" & Lastrow)...
Currently I have indicated: Listbox1(x,0).value
I do not know how to extract the Listbox value to the cell. This doesn't work. Listbox1(x) doesn't work. I need every row in the listbox to populate into the table.
Any help is appreciated.
Tammy

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:

Dynamic Filters in 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.

Resources