Excel data validation auto generate content - excel

I have an excel sheet A in which I clicked on a dropdown icon in a cell and the list of all the people in another data excel sheet B which I referenced to appears. In that data excel sheet B, each row is unique to each person with attributes of that particular person like identification number.
So when I clicked on the cell and selected a name from the dropdown list, I want the next cell to show the identification number of selected name. How do I go about doing that? I have no idea how to start.

Try combining Index and Match to achieve the reults you're looking for.
This way you dont hit the vlookup limitation of only being able to return values to the right of the lookup.
=Index(SheetB!A:A,Match(SheetA!A1,SheetB!B:B,0))
Assumed:
Sheet A's dropdown is in cell A1
Dropdown's Value needs to be looked up in column B of 'Sheet B'
We want the corresponding value from column A of the lookup in Sheet B to be returned.
Update the formula references, and this should get you on the right track.

Related

How to get a Drop down populated with sheet names to fill range of sheet cells?

Hi I hope someone can help.
I have a workbook column A is populated with titles leaving column B for data.
There is only these 2 columns in use.
I have the same titles in column A replicated on a series of sheets with column B filled out with client data.
On my first sheet (no data in column B) I'm attempting to use a single drop-down populated with the names given to the sheets on my workbook.
When a sheet name is selected from the drop-down This is to fill in the data from the corresponding sheet.
It's worth noting that all the titles are in the same cells on each sheet.
I can amalgamate all the client data onto one sheet if it's required for a solution but require one set of the data from a single drop-down on a separate sheet
I thought I might manage this with with some kind of range Vlookup linked to a separate sheet with the individual sheet names but i can't get my head round it.
Any help greatly appreciated.
Generally I use formulas in excel so if it's possible with VLookup or similar that's great if not then please drop some code for VBA.
From your description, Sheet11 is a customer data sheet and looks like this ...
The sheet that is looking up customer data looks like this ...
Cell D2 contains the drop down list to choose which customer data sheet to look at, in this case Sheet11.
Cell B2 contains the following formula, filled down...
=IF(ISERROR(VLOOKUP(A2,INDIRECT("'"&$D$2&"'!"&"A:B"),2,FALSE)),"",VLOOKUP(A2,INDIRECT("'"&$D$2&"'!"&"A:B"),2,FALSE))
It constructs a string representing the customer data to look in, and uses the INDIRECT function to convert that string into a valid reference. It uses VLookup to find the data of interest. If VLookup returns an error, a null string is returned, otherwise the customer data is returned.
Note: When constructing the string, the sheet name is enclosed in single quotes, in the event there is a space in the sheet name.

Setting the print Area in VBA to current cell in a column

I want to include just one column from a spreadsheet in print area but users can add a lot of rows so the column can grow dynamically. I want that column to be entirely included in print area. So, if say 10 rows were added, it would print those new 10 rows too. How would I do that in Excel VBA? There seem to be several methods of going about it from what I saw on the web but I am using this for the first time so I would appreciate your input on this. Thank you.
You do not need VBA for this.
Here is what to do.
Switch to the sheet you wish to have the dynamic print range on, say Sheet1.
Open the Name Manager with Control-F3.
Click the New button at the top.
For the Name field enter: print_area
For the Scope field select Sheet1 (or whichever sheet you are on).
For the Refers To field paste this formula:
=$A$1:INDEX($A:$A,MAX(IFERROR(MATCH({"*";9E+99},$A:$A,{-1;1}),1)))
Click OK and then Close
That's it.
Now as column A is added to the print range will include all of column A and nothing else... for that sheet only.
Note: If you want this for a different column than column A, simply change the A's in the formula to the different column label.

Excel Style Combo Box in Google Sheets

I have an issue regarding Google Sheets.
I have a spreadsheet in Google docs that i have copied from an excel spreadsheet that I created. What I need to figure out how to do is make a combo box that that when I select an option in the list it changes the value of another cell from a 1 to 2 or 3 or 4 etc.
I have this working in excel but cant seem to figure out how to do it in sheets.
My question is, does any one know of a way to do this? Is it even possible?
Maybe I am misunderstanding your question, but it seems to me that what you want can be achieved without any scripting (though it IS possible to script the whole thing, too):
For the "combo box" cell, add Data Validation selecting "List
from a range" or "List of items" under 'Criteria' as appropriate,
and "Reject input" option in 'On invalid data' section. This will
make the cell show a drop-down selection of items when you click on
the little arrow now displayed in the cell.
In the other cell (the one that needs to change value), enter a
formula that changes the cell value based on selected "combo box"
cell value. Depending on how big your list of items in the "combo
box" cell is, you can use either a simple IF() formula, or go for
a VLOOKUP() (if data validation items are coming from a range in a
spreadsheet), or a combination of them.
For example, based on the sheet as in the screenshot below, cells C1:C6 have Data Validation rule set to range F1:F6, and cells D1:D6 have the formula =IF(NOT(C1=""), VLOOKUP(C1, $F$1:$G$6, 2, FALSE), "DEFAULT VALUE") (obviously references to C1 changed to corresponding row of column D). When a value is selected from a drop-down in cells C1:C6, corresponding cell in column D changes its value to the one in column G matching selected value from column F. If no value is selected in cells C1:C6, corresponding cell in column D show "Default value" (which can be whatever you need).

VBA to return value from dynamic range (w. addition of new column)

I have a range C7:AD7 in workbook1 where C7:AC7 are random numbers and AD7 is the SUM of all those numbers. However, the SUM column shifts to the right after the user inserts a new column and enters a new random number. I have another workbook2 where I'd like to link to the SUM column and have the link automatically adjust as the workbook1 SUM columns moves to the right.
Can someone help me with this? Either VBA or through a formula?
Thanks
Jake
Give the cell a range-name (a defined name). Click in the sum's cell and go to the Formulas tab (Excel 2007/2010), Defined Names group and click Define Name. Type a name (without spaces) and click OK.
Open both books, begin a formula in the other book with '=', click to the other book and click on your named-cell. Excel will use the defined-name in the formula.
The defined-name will move with the cell, when a column is inserted.

How to create dropdown with multiple columns in excel

!
Hi I am using Excel 2003. I need to add data validation to a column, it should display the two columns in the cell, when user selects, the 1st column value should be displayed in cell.
Ex:
Col1 Col2
IND India
CHI China
Column - display to select
Column
IND-India
CHI-China
after selecting CHI the China or CHI will be displayed in the cell.
Is there any possibility to do the process in Excel.
Thanks in advance for any help...
(1)
If you need a dropdown item to display a different title after being selected, you can have another cell serve as the display. For example:
Where B3 (the helper cell) can have a formula like =LEFT($C$3,3) or use INDEX/MATCH to look up keys (like in your 'For Validation' table).
And where C3 (the data validation list) has a custom format like ;;;"(Change)" or "(Select)" or even a symbol like "↓", and will never display the actual selected list item.
You can also do this with VBA by creating an activex combo box control.
(2)
If you need one dropdown list to depend on the selection made in another, you can use dynamic dependent data validation:
http://www.myonlinetraininghub.com/excel-factor-19-dynamic-dependent-data-validation
Go to Devloper tab - insert - active control- insert comobobox
draw comobox in your excel sheet
right click on combobox, open property
in listfill range, type range of your column
set coloumn count = 2
change the widht of colomn
You can use the dropdown menu for the first column and the VLOOKUP function for the second column.
VLOOKUP would look at the first column and based on what's there would fill the second with the data from somewhere else.
I've also found a YouTube tutorial on how to use the function. Here you go:
https://www.youtube.com/watch?v=-WAEzokHSJM

Resources