Dynamic Combobox List Won't show Any List (Adapt from Contextures) Help!

radian89

Board Regular
Joined
Nov 12, 2015
Messages
113
Hi All,

I have encounter an error, while using dynamic data validation list, and adapt it to combobox list. it only works for only common data validation list.

the list placed on different sheet :
FORUM2.jpg


for the dynamic data validation list, I'm using formula :
=INDIRECT(VLOOKUP(B3,Named_Range,2,FALSE))

the combobox result an empty
FORUM3.jpg


My excel file can be download in :
http://s000.tinyupload.com/?file_id=89813714909094817910

My code is :
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

Dim str As String
Dim cboTemp As OLEObject
Dim ws As Worksheet

Set ws = ActiveSheet
On Error GoTo errHandler


    Set cboTemp = ws.OLEObjects("ComboBox1")
      On Error Resume Next
      With cboTemp
        .ListFillRange = ""
        .LinkedCell = ""
        .Visible = False
      End With


    On Error GoTo errHandler
      If Target.Validation.Type = 3 Then
        Cancel = True
        Application.EnableEvents = False
        str = Target.Validation.Formula1
        str = Right(str, Len(str) - 1)
        With cboTemp
          .Visible = True
          .Left = Target.Left
          .Top = Target.Top
          .Width = Target.Width + 15
          .Height = Target.Height + 5
          .ListFillRange = str
          .LinkedCell = Target.Address
        End With
        cboTemp.Activate
        'open the drop down list automatically
        Me.ComboBox1.DropDown
      End If


errHandler:
  Application.EnableEvents = True
  Exit Sub


End Sub

the link source for
combo box list :
http://www.contextures.com/xlDataVal10.html#AddCombo#AddCombo

dynamic data validation list :
http://www.contextures.com/xlDataVal02.html

thanks a lot for the help,
Warm regards

Adrian
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi,
quick glance at your code & that published by contextures shows:

this line in your code:
Code:
.ListFillRange = str

is not same as this in contextures code:

Code:
.ListFillRange = ws.Range(str).Address

which probably explains why you are getting nothing showing.

You may do well to re-install ALL the code published by contextures for this application.

Hope Helpful

Dave
 
Upvote 0

Forum statistics

Threads
1,215,487
Messages
6,125,073
Members
449,205
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top