Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
A.S.
 
Posts: n/a
Default Drop Down Box & Macro

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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Drop Down Box & Macro

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   Report Post  
Posted to microsoft.public.excel.misc
A.S.
 
Posts: n/a
Default Drop Down Box & Macro

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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Drop Down Box & Macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing a simple macro Connie Martin Excel Worksheet Functions 5 November 29th 05 09:19 PM
Selecting from a Validation Drop Down Box aborts macro Lreeder Excel Worksheet Functions 0 August 27th 05 01:41 AM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 04:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"