Hi, I have made some drop down menus using the data validation technique. This is a three tier system and it works perfectly fine. However I have decided to add a combo box overlay that appears on double click using the code below. This works for the first set of drop downs, but not the second and third tier (I'd imagine because they use INDIRECT, within the sourcing). I have attached the file that I am working with, any help is appreciated.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim str As String
Dim cboTemp As OLEObject
Dim ws As Worksheet
Dim wsList As Worksheet
Set ws = ActiveSheet
Set wsList = Sheets("Sheet1")
Set cboTemp = ws.OLEObjects("TempCombo")
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
End If
errHandler:
Application.EnableEvents = True
Exit Sub
End Sub
I have tried using the following, to convert the "indirects" to proper cell references but have had no luck.
.listfillrange= Me.Evaluate(str).Address
Bookmarks