List box

T

Tammy

Is there a way I can do something similar to a list/combo
box in multiple cells. I have a vlookup based on the
value assigned to a cell by a list box; I would like to
be able to drag the list box to fill the cells below (but
with a different value every time).

i guess the point is to have the abilty to pull all my
formulas down and not have to recreate the list box of
linked cell every time.

Any suggestions would be greatly appreciated.

Thanks in advance!
 
D

Dick Kusleika

Tammy

If I understand you correctly, you can use one listbox, but move it as
needed. First, create the listbox and don't put anything in the linked cell
property. Then use the worksheet_SelectionChange event like this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Column = 1 Then
Me.ListBox1.Visible = True
Me.ListBox1.Top = Target.Top
Me.ListBox1.Left = Target.Left + Target.Width
Else
Me.ListBox1.Visible = False
End If

End Sub

If you click in column A, the listbox appears next to the cell that you
clicked. If you click in any other column, it disappears. Then use the
Click event of the Listbox like this

Private Sub ListBox1_Click()

ActiveCell.Value = Me.ListBox1.Value

End Sub

If you select cell A10, the listbox appears next to. You make a selection
from the listbox and it puts it in A10.

Is that what you're after?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top