LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Autocomplete not triggering worksheet change

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RTD value changes not triggering worksheet change event DTM[_4_] Excel Programming 2 June 7th 06 05:01 PM
Validation not triggering Change event in Excel XP Jeffrey[_8_] Excel Programming 3 March 13th 06 03:33 AM
Validation not triggering Change event in Excel XP Jeffrey[_8_] Excel Programming 1 March 8th 06 01:59 AM
help on triggering macro if cells change cuewoz Excel Programming 6 March 6th 06 07:52 PM
auto-filter change not triggering worksheet_change event mark Excel Programming 1 September 19th 03 03:01 PM


All times are GMT +1. The time now is 01:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"