Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello,
I want to create a macro so that when I select a country from a drop down box, then hidden data for the country appears. For example, I select Argentina from the box, then data will appear on the population, econmic info., etc. However, I can then choose Mexico from the box and the same data appears for Mexico. Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You may not need a macro.
Say you have a table with all your info on it in sheet2--country name in column A. Then you could use a formula like: =if(a1="","",vlookup(a1,sheet2!a:e,2,false)) You may want to read Debra Dalgleish's notes: http://www.contextures.com/xlFunctions02.html A.S. wrote: Hello, I want to create a macro so that when I select a country from a drop down box, then hidden data for the country appears. For example, I select Argentina from the box, then data will appear on the population, econmic info., etc. However, I can then choose Mexico from the box and the same data appears for Mexico. Thanks in advance. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Dave,
I forgot to mention, that there is a catch. The reason I say I need a macro is that I want the data to be changeable & not from a list. Example: My Drop Down Box has countries from A-Z. The categories are population, and let's say internet penetration. Now, when I select Brazil, I input the population and internet penetration, after I do that, then I go back to the drop-down box and select China and input data for China. And I want to be able to do this for whichever country I choose. Any ideas? "Dave Peterson" wrote: You may not need a macro. Say you have a table with all your info on it in sheet2--country name in column A. Then you could use a formula like: =if(a1="","",vlookup(a1,sheet2!a:e,2,false)) You may want to read Debra Dalgleish's notes: http://www.contextures.com/xlFunctions02.html A.S. wrote: Hello, I want to create a macro so that when I select a country from a drop down box, then hidden data for the country appears. For example, I select Argentina from the box, then data will appear on the population, econmic info., etc. However, I can then choose Mexico from the box and the same data appears for Mexico. Thanks in advance. -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I think I would separate the functions into two pieces.
One would be updating the table. I'd do it directly in the second sheet. But maybe you'd rather use Data|Form. And since the table is resizing, you could use a dynamic name for the data|validation cell. See Debra Dalgeish's site for some nice tips: http://contextures.com/xlNames01.html#Dynamic Then the second part would be using the =vlookup() formulas. A.S. wrote: Hi Dave, I forgot to mention, that there is a catch. The reason I say I need a macro is that I want the data to be changeable & not from a list. Example: My Drop Down Box has countries from A-Z. The categories are population, and let's say internet penetration. Now, when I select Brazil, I input the population and internet penetration, after I do that, then I go back to the drop-down box and select China and input data for China. And I want to be able to do this for whichever country I choose. Any ideas? "Dave Peterson" wrote: You may not need a macro. Say you have a table with all your info on it in sheet2--country name in column A. Then you could use a formula like: =if(a1="","",vlookup(a1,sheet2!a:e,2,false)) You may want to read Debra Dalgleish's notes: http://www.contextures.com/xlFunctions02.html A.S. wrote: Hello, I want to create a macro so that when I select a country from a drop down box, then hidden data for the country appears. For example, I select Argentina from the box, then data will appear on the population, econmic info., etc. However, I can then choose Mexico from the box and the same data appears for Mexico. Thanks in advance. -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Editing a simple macro | Excel Worksheet Functions | |||
Selecting from a Validation Drop Down Box aborts macro | Excel Worksheet Functions | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |