Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
Just to confirm I got it to work. I hadn't activated the seperate procedure in the correct place but now I have done what I should have one in the first place it works perfecly. Many thanks for your efforts. Graham Graham Haughs wrote: Thanks for your efforts Tom. I will persevere and see what mistake I am making with your code. Graham Tom Ogilvy wrote: I tested it after your post with all code you had posted to date and including my changes and my added event, and it worked for me. I would probably add code to clear the selection each time in the TempCombo or include a mousedown event to do it so you can select the same item - but as for the issue at hand, as I said, it worked for me. -- Regards, Tom Ogilvy "Graham Haughs" wrote in message ... Sorry to be a pain Tom but selections from the combo boxes are not being accepted with this, ie they are taking an entry but not the one selected, and the event is not being triggered. Graham Tom Ogilvy wrote: 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 Cancel = True Set cboTemp = ws.OLEObjects("TempCombo") On Error Resume Next With cboTemp 'clear and hide the combo box .ListFillRange = "" .LinkedCell = "" .Visible = False End With On Error GoTo errHandler If Target.Validation.Type = 3 Then 'if the cell contains a data validation list Application.EnableEvents = False 'get the data validation formula str = Target.Validation.Formula1 str = Right(str, Len(str) - 1) With cboTemp 'show the combobox with the list .Visible = True .Left = Target.Left .Top = Target.Top .Width = Target.Width + 5 .Height = Target.Height + 5 .ListFillRange = ws.Range(str).Address .LinkedCell = "" '<== changed End With cboTemp.Activate End If errHandler: Application.EnableEvents = True Exit Sub End Sub ' added: Private Sub TempCombo_Click() Dim rng as Range set rng = ActiveSheet.OleObjects("TempCombo").TopLeftCell rng.Value = me.TempCombo.Value end Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
RTD value changes not triggering worksheet change event | Excel Programming | |||
Validation not triggering Change event in Excel XP | Excel Programming | |||
Validation not triggering Change event in Excel XP | Excel Programming | |||
help on triggering macro if cells change | Excel Programming | |||
auto-filter change not triggering worksheet_change event | Excel Programming |