ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   2 column drop down lists (https://www.excelbanter.com/excel-discussion-misc-queries/13138-re-2-column-drop-down-lists.html)

peterm

2 column drop down lists
 
Hi Jeff
If you want eg Column 1 NY column 2 New York use a vlookup.
If this is want you want let me know & I will send it.
Peterm

"Jeff" wrote:

I know that I have seen this before, but I can't recall
how to do it. I want to create a drop down list with 2
columns. e.g. column 1 would be state short forms and
column 2 would be the full name.

Any suggestions would be greatly appreciated.

Jeff


Bob Phillips

Use a combobox from the controls toolbox, set the data up in a table and set
the ListFillRange property of the combo to that table, and set the
columncount property to 2.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"peterm" wrote in message
...
Hi Jeff
If you want eg Column 1 NY column 2 New York use a vlookup.
If this is want you want let me know & I will send it.
Peterm

"Jeff" wrote:

I know that I have seen this before, but I can't recall
how to do it. I want to create a drop down list with 2
columns. e.g. column 1 would be state short forms and
column 2 would be the full name.

Any suggestions would be greatly appreciated.

Jeff




Jim May

Bob:
experimenting with this I also had to change "Bound Column" to 2.
I suppose that only one of the 2 columns in the FillListRange can be
pasted in...
Also, don't suppose that one could (/??? - however ??) have Linked Cell
advance by 1 - Originally set to say B1 and with each select/paste
the data move downward B2, B3, B4 etc,,,
TIA,
Jim

"Bob Phillips" wrote in message
...
Use a combobox from the controls toolbox, set the data up in a table and

set
the ListFillRange property of the combo to that table, and set the
columncount property to 2.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"peterm" wrote in message
...
Hi Jeff
If you want eg Column 1 NY column 2 New York use a vlookup.
If this is want you want let me know & I will send it.
Peterm

"Jeff" wrote:

I know that I have seen this before, but I can't recall
how to do it. I want to create a drop down list with 2
columns. e.g. column 1 would be state short forms and
column 2 would be the full name.

Any suggestions would be greatly appreciated.

Jeff






Bob Phillips

Hi Jim,

The boundcolumn property identifies which column is selected when the
combobox is clicked. So if you want column 1 value, you don't need to set
that property as that is the default. If you want the second, set it to 2,
etc. If you set the BoundColumn value greater than the ColumnCount value,
you get #N/A.

If you want to pick up multiple columns from the combobox, you will need to
manage it within the click event, it only links back to 1 even if you
specify multiples.

There is nothing to automatically do the second part, but you could drive it
yourself in the click event of the combobox (remember this is a control
toolbox combobox) with code like this

Private Sub ComboBox1_Click()
Dim target As String

With Me.ComboBox1
target = .LinkedCell
.LinkedCell = Me.Range(target).Offset(1, 0).Address
End With
End Sub


Regards

Bob

"Jim May" wrote in message
news:6IlQd.63794$jn.51653@lakeread06...
Bob:
experimenting with this I also had to change "Bound Column" to 2.
I suppose that only one of the 2 columns in the FillListRange can be
pasted in...
Also, don't suppose that one could (/??? - however ??) have Linked Cell
advance by 1 - Originally set to say B1 and with each select/paste
the data move downward B2, B3, B4 etc,,,
TIA,
Jim

"Bob Phillips" wrote in message
...
Use a combobox from the controls toolbox, set the data up in a table and

set
the ListFillRange property of the combo to that table, and set the
columncount property to 2.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"peterm" wrote in message
...
Hi Jeff
If you want eg Column 1 NY column 2 New York use a vlookup.
If this is want you want let me know & I will send it.
Peterm

"Jeff" wrote:

I know that I have seen this before, but I can't recall
how to do it. I want to create a drop down list with 2
columns. e.g. column 1 would be state short forms and
column 2 would be the full name.

Any suggestions would be greatly appreciated.

Jeff








Jim May

Thanks Bob for the code - I've printed it out so as to review
it between stop-lights (as I now leave for work).
Jim

"Bob Phillips" wrote in message
...
Hi Jim,

The boundcolumn property identifies which column is selected when the
combobox is clicked. So if you want column 1 value, you don't need to set
that property as that is the default. If you want the second, set it to 2,
etc. If you set the BoundColumn value greater than the ColumnCount value,
you get #N/A.

If you want to pick up multiple columns from the combobox, you will need

to
manage it within the click event, it only links back to 1 even if you
specify multiples.

There is nothing to automatically do the second part, but you could drive

it
yourself in the click event of the combobox (remember this is a control
toolbox combobox) with code like this

Private Sub ComboBox1_Click()
Dim target As String

With Me.ComboBox1
target = .LinkedCell
.LinkedCell = Me.Range(target).Offset(1, 0).Address
End With
End Sub


Regards

Bob

"Jim May" wrote in message
news:6IlQd.63794$jn.51653@lakeread06...
Bob:
experimenting with this I also had to change "Bound Column" to 2.
I suppose that only one of the 2 columns in the FillListRange can be
pasted in...
Also, don't suppose that one could (/??? - however ??) have Linked Cell
advance by 1 - Originally set to say B1 and with each select/paste
the data move downward B2, B3, B4 etc,,,
TIA,
Jim

"Bob Phillips" wrote in message
...
Use a combobox from the controls toolbox, set the data up in a table

and
set
the ListFillRange property of the combo to that table, and set the
columncount property to 2.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"peterm" wrote in message
...
Hi Jeff
If you want eg Column 1 NY column 2 New York use a vlookup.
If this is want you want let me know & I will send it.
Peterm

"Jeff" wrote:

I know that I have seen this before, but I can't recall
how to do it. I want to create a drop down list with 2
columns. e.g. column 1 would be state short forms and
column 2 would be the full name.

Any suggestions would be greatly appreciated.

Jeff











All times are GMT +1. The time now is 03:55 PM.

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