ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populating a cell from a picklist selection (https://www.excelbanter.com/excel-programming/298565-populating-cell-picklist-selection.html)

Phil Servedio

Populating a cell from a picklist selection
 
In the spreadsheet example below, I need to populate
F2 with the numeric association of the selection from the
picklist. So, for example if Low is selected, F2=20, Med then
F2 gets 40 and so on.

A B C D E F G
1) Lo Med Hi VHi Huge
2) 20 40 60 80 100 [ ] Low
Med <-- Data Validation picklist
Hi
VHi

The question is, can a formula be built within the
data validation itself to populate F2? (I know that using a
HLookup within F2 can do it, but I also want to allow the user
to enter custom values).

Is a formula possible (using indirect, hlookup, offset, etc),
or do I have to use a VBA content change event?

-Phil

Frank Kabel

Populating a cell from a picklist selection
 
Hi
you have to use the worksheet_change event.

--
Regards
Frank Kabel
Frankfurt, Germany


Phil Servedio wrote:
In the spreadsheet example below, I need to populate
F2 with the numeric association of the selection from the
picklist. So, for example if Low is selected, F2=20, Med then
F2 gets 40 and so on.

A B C D E F G
1) Lo Med Hi VHi Huge
2) 20 40 60 80 100 [ ] Low
Med <-- Data Validation
picklist Hi
VHi

The question is, can a formula be built within the
data validation itself to populate F2? (I know that using a
HLookup within F2 can do it, but I also want to allow the user
to enter custom values).

Is a formula possible (using indirect, hlookup, offset, etc),
or do I have to use a VBA content change event?

-Phil




All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com