VB to dsiplay value from drop down list

R

Ray :-)

Hi, is there a way to use code to display the value selected from the
drop down list directly on a specific cell? I originally used the
vlookup function and it worked well. However, I have added the
following code to my two related drop down and the vlookup function for
matching the value of drop down 2 is no longer working. Could anyone
please help me out? If VB code is required, where should I put it?
Thanks in advance.


Option Explicit
Sub ddMstr()

Dim dd As DropDown
Dim dd1 As DropDown

Set dd = ActiveSheet.DropDowns(Application.Caller)

With dd
If .ListIndex > 0 Then
Set dd1 = ActiveSheet.DropDowns("drop down 2")
dd1.ListFillRange = Worksheets("sheet2").Range("list" _
& dd.ListIndex).Address(external:=True)
dd1.ListIndex = 0
End If
End With
End Sub


Sub ddSub()
Dim dd As DropDown
Set dd = ActiveSheet.DropDowns(Application.Caller)

With dd
If .ListIndex > 0 Then
End If
End With
End Sub
 

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