Combobox search dropdown triggering when editing other sheets

Greenbehindthecells

Board Regular
Joined
May 9, 2023
Messages
50
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,

I hope everyone is having a great afternoon. My combobox triggers when editing other cells in other sheets. This has been happening during the course of making this sheet, way before I asked and received code help. I am not sure how to resolve this. I will have members of my team enter data on a sheet in this workbook for corrections. If the combobox could only trigger when text is entered in the combobox, it would save a lot of headaches. Any assistance or guidance would be appreciated. I hope you have a wonderful day.





Combobox behavior normal:

1691436808191.png

Combobox triggering (and making itself visible) when editing cells in other sheets.

1691436878057.png



Ufiltering data in my data sheet also has this same result, the combobox search from Pratice Details V2 pops up.

1691437171970.png


File Structure:
List (where my dropdown formula is) :
Combobox.xlsm
ABCDEFGHIJ
1ResponsePraticesSearchable
2YesABCBBCNot found
3NoABC PEDSBBC CARD
4UnkownABC GIBBC GI
5ABC CARDBBC NEPH
6ABC NEPHBBC PEDS
7BBC
8BBC PEDS
9BBC GI
10PCPPapsBBC CARD
11YesBBC NEPH
12NoCBC
13UnkownCBC PEDS
14Specific Provider OnlyCBC GI
15CBC CARD
16CBC NEPH
17DBC
18DBC PEDS
19DBC GI
20DBC CARD
21DBC NEPH
22
23
24
25
List
Cell Formulas
RangeFormula
E2:E6E2=SORT(FILTER(Practices6[#Data],ISNUMBER(SEARCH('Practice Details V2'!$D$2,Practices6[#Data])),"Not found"))
F2F2=SORT(FILTER(Practices6[#Data],ISTEXT(SEARCH('Practice Details V2'!$D$2,Practices6[#Data])),"Not found"))
Dynamic array formulas.


Practice Details V2 (where combobox is) cell D2:
Combobox.xlsm
ABCDEFIJMNOPQRSTUV
1ContactHours
2BBCformula from other sheetNot on file
3
4
5
6TaxNPIProvAddressesCityStatePhoneFax
78888888889999999994WILLIAMS, MICHAEL, MD11 BROADWAY, STE 1WILMINGTONDE11000000019999999930County Health Dept
89999999974LEWIS, BENJAMIN, MDformula from other sheet
99999999954PHILLIPS, SOPHIA, DO
109999999934MYERS, CHLOE, MD
11
12
13
14Misc Notes
15formula from other sheet
16
17
18
19P?POC?
20formula from other sheetformula from other sheet
21
22
23
24LanguagesAcron
25Not on FileEE
26
27
Practice Details V2
Cell Formulas
RangeFormula
N2N2=IFERROR(INDEX(NewPract[#Data],MATCH($D$2,NewPract[GROUP NAME],0),15)," ")
B7B7=IFERROR(FILTER(UNIQUE(IF(FILTER(NewPract[TAX ID (TAB REPORT)],EXACT(NewPract[GROUP NAME],$D$2))=0,"No Data",FILTER(NewPract[TAX ID (TAB REPORT)],EXACT(NewPract[GROUP NAME],$D$2)))),UNIQUE(IF(FILTER(NewPract[TAX ID (TAB REPORT)],EXACT(NewPract[GROUP NAME],$D$2))=0,"No Data",FILTER(NewPract[TAX ID (TAB REPORT)],EXACT(NewPract[GROUP NAME],$D$2))))<>""),"make a selection")
C7:D10C7=IFERROR(UNIQUE(IF(FILTER(NewPract[NPI],EXACT(NewPract[GROUP NAME],$D$2))=0,"no data available",FILTER(NewPract[[NPI]:[PRINT NAME]],EXACT(NewPract[GROUP NAME],$D$2)))),"make selection in field")
F7:N7F7=IFERROR(UNIQUE(IF(FILTER(NewPract[ADDRESS3],EXACT(NewPract[GROUP NAME],$D$2))=0,"No data avialable",FILTER(NewPract[[ADDRESS3]:[FAX (TAB REP MATCH)]],EXACT(NewPract[GROUP NAME],$D$2)))),"make selection in field")
P25P25=FILTER(IFERROR(UNIQUE(IF(FILTER(NewPract[LANG CONSOL],EXACT(NewPract[GROUP NAME],$D$2))=0,"not on file",FILTER(NewPract[LANG CONSOL],EXACT(NewPract[GROUP NAME],$D$2)))),"make Selection in field"),IFERROR(UNIQUE(IF(FILTER(NewPract[LANG CONSOL],EXACT(NewPract[GROUP NAME],$D$2))=0,"not on file",FILTER(NewPract[LANG CONSOL],EXACT(NewPract[GROUP NAME],$D$2)))),"make Selection in field")<>"")
R25R25=IFERROR(UNIQUE(IF(FILTER(NewPract[LOB],EXACT(NewPract[GROUP NAME],$D$2))=0,"No data availabe",FILTER(NewPract[LOB],EXACT(NewPract[GROUP NAME],$D$2)))),"Make selection field")
Dynamic array formulas.


DD SS NN FF Main (where data is)
Combobox.xlsm
ABCDEFGHIJKLMNO
1GROUP NAMETAX ID (TAB REPORT)NPIPRINT NAMEADDRESS3ADDRESS1ADDRESS2CITYSTATEZIPCOUNTYPHONEFAX (TAB REP MATCH)LANG CONSOLHOURS CONSOL
2ABC9999999999999999999NIEVES, JESUS, DO11 BROADWAY, STE 1111 BROADWAYSTE 11WILMINGTONDE19801NEW CASTLE (F)(999) 999-9991(999) 999-9992GREEK, MANDARINMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
3ABC9999999999999999979GARCIA, NANCY, DO11 BROADWAY, STE 1111 BROADWAYSTE 11WILMINGTONDE19801NEW CASTLE (F)(999) 999-9991(999) 999-9992Not on FileMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
4ABC9999999999999999959RIVERA, ALEXANDER, MD11 BROADWAY, STE 1111 BROADWAYSTE 11WILMINGTONDE19801NEW CASTLE (F)(999) 999-9991(999) 999-9992GREEK, MANDARINMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
5ABC9999999999999999939COOPER, NATHAN, MD11 BROADWAY, STE 1111 BROADWAYSTE 11WILMINGTONDE19801NEW CASTLE (F)(999) 999-9991(999) 999-9992POLISH, PORTEGUESEMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
6ABC CARD9999999999999999996SHIN, XE, DO10 BROADWAY, STE 2210 BROADWAYSTE 22WILMINGTONDE19801NEW CASTLE (F)(999) 999-9997(999) 999-9998RUSSIANMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
7ABC CARD9999999999999999976CLARK, EDWARD, MD10 BROADWAY, STE 2210 BROADWAYSTE 22WILMINGTONDE19801NEW CASTLE (F)(999) 999-9997(999) 999-9998DUTCHMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
8ABC CARD9999999999999999956ROBERTS, ALEXIS, MD10 BROADWAY, STE 2210 BROADWAYSTE 22WILMINGTONDE19801NEW CASTLE (F)(999) 999-9997(999) 999-9998RUSSIANMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
9ABC CARD9999999999999999936GRIFFIN, AVERY, DO10 BROADWAY, STE 2210 BROADWAYSTE 22WILMINGTONDE19801NEW CASTLE (F)(999) 999-9997(999) 999-9998DUTCHMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
10ABC GI9999999999999999997CARTER, CARTER, DO10 BROADWAY, STE 1110 BROADWAYSTE 11WILMINGTONDE19801NEW CASTLE (F)(999) 999-9995(999) 999-9996SPANISHMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
11ABC GI9999999999999999977ROBINSON, DONNA, MD10 BROADWAY, STE 1110 BROADWAYSTE 11WILMINGTONDE19801NEW CASTLE (F)(999) 999-9995(999) 999-9996HAITIANMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
12ABC GI9999999999999999957PEREZ, ANTHONY, DO10 BROADWAY, STE 1110 BROADWAYSTE 11WILMINGTONDE19801NEW CASTLE (F)(999) 999-9995(999) 999-9996SPANISHMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
13ABC GI9999999999999999937COX, LUCAS, MD10 BROADWAY, STE 1110 BROADWAYSTE 11WILMINGTONDE19801NEW CASTLE (F)(999) 999-9995(999) 999-9996HAITIANMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
14ABC NEPH9999999999999999995OHNSON, LISA, DO9 BROADWAY, STE 19 BROADWAYSTE 1WILMINGTONDE19801NEW CASTLE (F)(999) 999-9999(999) 999-9910POLISH, PORTEGUESEMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: CLOSED, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
15ABC NEPH9999999999999999975RODRIGUEZ, AMY, DO9 BROADWAY, STE 19 BROADWAYSTE 1WILMINGTONDE19801NEW CASTLE (F)(999) 999-9999(999) 999-9910GREEK, MANDARINMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: CLOSED, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
16ABC NEPH9999999999999999955TURNER, JOSEPH, MD9 BROADWAY, STE 19 BROADWAYSTE 1WILMINGTONDE19801NEW CASTLE (F)(999) 999-9999(999) 999-9910POLISH, PORTEGUESEMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: CLOSED, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
17ABC NEPH9999999999999999935HAYES, ZACHARY, MD9 BROADWAY, STE 19 BROADWAYSTE 1WILMINGTONDE19801NEW CASTLE (F)(999) 999-9999(999) 999-9910GREEK, MANDARINMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: CLOSED, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
18ABC PEDS9999999999999999998SMITH, JOHN, DO11 BROADWAY, STE 2211 BROADWAYSTE 22WILMINGTONDE19801NEW CASTLE (F)(999) 999-9993(999) 999-9994Not on FileNot on file
19ABC PEDS9999999999999999978MARTINEZ, KEVIN, MD11 BROADWAY, STE 2211 BROADWAYSTE 22WILMINGTONDE19801NEW CASTLE (F)(999) 999-9993(999) 999-9994TELUGONot on file
20ABC PEDS9999999999999999958MITCHELL, OLIVIA, MD11 BROADWAY, STE 2211 BROADWAYSTE 22WILMINGTONDE19801NEW CASTLE (F)(999) 999-9993(999) 999-9994Not on FileNot on file
21ABC PEDS9999999999999999938RICHARDSON, JASMINE, DO11 BROADWAY, STE 2211 BROADWAYSTE 22WILMINGTONDE19801NEW CASTLE (F)(999) 999-9993(999) 999-9994TELUGONot on file
22BBC8888888889999999994WILLIAMS, MICHAEL, MD11 BROADWAY, STE 111 BROADWAYSTE 1WILMINGTONDE19801NEW CASTLE (F)(110) 000-0001(999) 999-9930Not on FileNot on file
23BBC8888888889999999974LEWIS, BENJAMIN, MD11 BROADWAY, STE 111 BROADWAYSTE 1WILMINGTONDE19801NEW CASTLE (F)(110) 000-0001(999) 999-9930Not on FileNot on file
24BBC8888888889999999954PHILLIPS, SOPHIA, DO11 BROADWAY, STE 111 BROADWAYSTE 1WILMINGTONDE19801NEW CASTLE (F)(110) 000-0001(999) 999-9930Not on FileNot on file
25BBC8888888889999999934MYERS, CHLOE, MD11 BROADWAY, STE 111 BROADWAYSTE 1WILMINGTONDE19801NEW CASTLE (F)(110) 000-0001(999) 999-9930Not on FileNot on file
26BBC CARD8888888889999999991DAVIS, MARY, DO10 BROADWAY, STE 410 BROADWAYSTE 4WILMINGTONDE19801NEW CASTLE (F)(110) 000-0004(999) 999-9882GREEK, MANDARINMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
27BBC CARD8888888889999999971HALL, RICHARD, MD10 BROADWAY, STE 410 BROADWAYSTE 4WILMINGTONDE19801NEW CASTLE (F)(110) 000-0004(999) 999-9882POLISH, PORTEGUESEMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
28BBC CARD8888888889999999951EVANS, JACK, MD10 BROADWAY, STE 410 BROADWAYSTE 4WILMINGTONDE19801NEW CASTLE (F)(110) 000-0004(999) 999-9882GREEK, MANDARINMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
29BBC CARD8888888889999999931GRAHAM, ADAM, MD10 BROADWAY, STE 410 BROADWAYSTE 4WILMINGTONDE19801NEW CASTLE (F)(110) 000-0004(999) 999-9882POLISH, PORTEGUESEMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
30BBC GI8888888889999999992BROWN, ROBERT, MD10 BROADWAY, STE 310 BROADWAYSTE 3WILMINGTONDE19801NEW CASTLE (F)(110) 000-0003(999) 999-9898DUTCHMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
31BBC GI8888888889999999972WALKER, ANNA, DO10 BROADWAY, STE 310 BROADWAYSTE 3WILMINGTONDE19801NEW CASTLE (F)(110) 000-0003(999) 999-9898RUSSIANMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
32BBC GI8888888889999999952PARKER, MIA, DO10 BROADWAY, STE 310 BROADWAYSTE 3WILMINGTONDE19801NEW CASTLE (F)(110) 000-0003(999) 999-9898DUTCHMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
33BBC GI8888888889999999932HAMILTON, ARIA, MD10 BROADWAY, STE 310 BROADWAYSTE 3WILMINGTONDE19801NEW CASTLE (F)(110) 000-0003(999) 999-9898RUSSIANMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: 8:00AM TO 5PM, FRI: 8:00AM TO 5PM, SAT: CLOSED, SUN: CLOSED
34BBC NEPH8888888889999999990MILLER, JAMES, MD9 BROADWAY, STE 59 BROADWAYSTE 5WILMINGTONDE19801NEW CASTLE (F)(110) 000-0005(999) 999-9866Not on FileMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: CLOSED, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
35BBC NEPH8888888889999999970ALLEN, LINDSEY, DO9 BROADWAY, STE 59 BROADWAYSTE 5WILMINGTONDE19801NEW CASTLE (F)(110) 000-0005(999) 999-9866TELUGOMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: CLOSED, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
36BBC NEPH8888888889999999950EDWARDS, ISABELLA, MD9 BROADWAY, STE 59 BROADWAYSTE 5WILMINGTONDE19801NEW CASTLE (F)(110) 000-0005(999) 999-9866Not on FileMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: CLOSED, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
37BBC NEPH8888888889999999930SULLIVAN, HARPER, DO9 BROADWAY, STE 59 BROADWAYSTE 5WILMINGTONDE19801NEW CASTLE (F)(110) 000-0005(999) 999-9866TELUGOMON: 8:00AM TO 5PM, TUES: 8:00AM TO 5PM, WED: 8:00AM TO 5PM, THURS: CLOSED, FRI: 8:00AM TO 5PM, SAT: 8:00AM TO 5PM, SUN: CLOSED
38BBC PEDS8888888889999999993JONES, SARAH, DO11 BROADWAY, STE 211 BROADWAYSTE 2WILMINGTONDE19801NEW CASTLE (F)(110) 000-0002(999) 999-9914HAITIANNot on file
39BBC PEDS8888888889999999973LEE, KAREN, MD11 BROADWAY, STE 211 BROADWAYSTE 2WILMINGTONDE19801NEW CASTLE (F)(110) 000-0002(999) 999-9914SPANISHNot on file
40BBC PEDS8888888889999999953CAMPBELL, SAMUEL, MD11 BROADWAY, STE 211 BROADWAYSTE 2WILMINGTONDE19801NEW CASTLE (F)(110) 000-0002(999) 999-9914HAITIANNot on file
41BBC PEDS8888888889999999933FORD, WYATT, DO11 BROADWAY, STE 211 BROADWAYSTE 2WILMINGTONDE19801NEW CASTLE (F)(110) 000-0002(999) 999-9914SPANISHNot on file
DD SS NN FF Main
Cell Formulas
RangeFormula
N2:N41N2=IF(AND([@LANG1]=0,[@LANG2]=0,[@LANG3]=0,[@LANG4]=0,[@LANG5]=0,[@LANG6]=0),"Not on File",TEXTJOIN(", ",TRUE,NewPract[@[LANG1]:[LANG6]]))
O2:O41O2=IF(AND( [@MON]=0,[@TUE]=0,[@WED]=0,[@THUR]=0,[@FRI]=0,[@SAT]=0,[@SUN]=0), "Not on file",TEXTJOIN(", ",TRUE,"MON: "&[@MON], "TUES: "&[@TUE],"WED: "&[@WED],"THURS: "&[@THUR],"FRI: "&[@FRI],"SAT: "&[@SAT], "SUN: "&[@SUN]))
E2:E41E2=TEXTJOIN(", ",TRUE,[@ADDRESS1],[@ADDRESS2])

Properties.PNG

Code:

Private Sub Tempbox2_Change()
Tempbox2.ListFillRange = "Dropdown1"
Me.Tempbox2.DropDown
End Sub

Private Sub Tempbox4_Change()
Tempbox4.ListFillRange = "Dropdown1"
Me.Tempbox4.DropDown
End Sub
Private Sub Tempbox4_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
With Tempbox4
Select Case KeyCode
Case 13 'ENTER
If .ListIndex > -1 Then
Range("D2") = .Value 'send combobox value to cell D2 'adjust the cell reference
Else
MsgBox "Found nothing"
End If

End Select
End With
End Sub
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
My combobox triggers when editing other cells in other sheets.
That's because you are using Linked cell, it must be empty.

Try replacing all your code above with this:
VBA Code:
Private Sub Tempbox4_Change()
With Tempbox4
    If .ListCount = 0 Then
        .List = Range("Dropdown1").Value
    End If
End With
Me.Tempbox4.DropDown
End Sub

Private Sub Tempbox4_GotFocus()
With Tempbox4
    .LinkedCell = Empty
    .ListFillRange = Empty
    .List = Range("Dropdown1").Value
End With
End Sub

Private Sub Tempbox4_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
With Tempbox4
    Select Case KeyCode
    Case 13 'ENTER
        If .ListIndex > -1 Then
          Range("D2") = .Value 'send combobox value to cell D2 'adjust the cell reference
        Else
          MsgBox "Found nothing"
        End If
    End Select
End With
End Sub

Note: After you pick an item in the combobox, you need to press Enter to send combobox value to cell D2
 
Upvote 0
That's because you are using Linked cell, it must be empty.

Try replacing all your code above with this:
VBA Code:
Private Sub Tempbox4_Change()
With Tempbox4
    If .ListCount = 0 Then
        .List = Range("Dropdown1").Value
    End If
End With
Me.Tempbox4.DropDown
End Sub

Private Sub Tempbox4_GotFocus()
With Tempbox4
    .LinkedCell = Empty
    .ListFillRange = Empty
    .List = Range("Dropdown1").Value
End With
End Sub

Private Sub Tempbox4_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
With Tempbox4
    Select Case KeyCode
    Case 13 'ENTER
        If .ListIndex > -1 Then
          Range("D2") = .Value 'send combobox value to cell D2 'adjust the cell reference
        Else
          MsgBox "Found nothing"
        End If
    End Select
End With
End Sub

Note: After you pick an item in the combobox, you need to press Enter to send combobox value to cell D2
Good morning,

Thank you. I replaced all the code with this code and received a runtime error.


1691505119561.png
1691505151681.png
 
Upvote 0
Sorry, I tested it with the "Dropdown1" was on the same sheet as the combobox.
Try this:
In VBA editor, in property window, in Tempbox4 property, you need to clear: LinkedCell & ListFillRange.
Then replace the previous code with this:

VBA Code:
Private Sub Tempbox4_Change()
With Tempbox4
    If .ListCount = 0 Then
        .List = Sheets("Sheet2").Range("Dropdown1").Value 'change sheet reference to suit
    End If
End With
Me.Tempbox4.DropDown
End Sub

Private Sub Tempbox4_GotFocus()
With Tempbox4
    .List = Sheets("Sheet2").Range("Dropdown1").Value 'change sheet reference to suit
End With
End Sub

Private Sub Tempbox4_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
With Tempbox4
    Select Case KeyCode
    Case 13 'ENTER
        If .ListIndex > -1 Then
          Range("D2") = .Value 'send combobox value to cell D2 'adjust the cell reference
        Else
          MsgBox "Found nothing"
        End If
    End Select
End With
End Sub

You need to adjust the code in this part:
VBA Code:
.List = Sheets("Sheet2").Range("Dropdown1").Value 'change sheet reference to suit
change sheet reference to where the named range "Dropdown1" is located.
 
Upvote 0
Sorry, I tested it with the "Dropdown1" was on the same sheet as the combobox.
Try this:
In VBA editor, in property window, in Tempbox4 property, you need to clear: LinkedCell & ListFillRange.
Then replace the previous code with this:

VBA Code:
Private Sub Tempbox4_Change()
With Tempbox4
    If .ListCount = 0 Then
        .List = Sheets("Sheet2").Range("Dropdown1").Value 'change sheet reference to suit
    End If
End With
Me.Tempbox4.DropDown
End Sub

Private Sub Tempbox4_GotFocus()
With Tempbox4
    .List = Sheets("Sheet2").Range("Dropdown1").Value 'change sheet reference to suit
End With
End Sub

Private Sub Tempbox4_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
With Tempbox4
    Select Case KeyCode
    Case 13 'ENTER
        If .ListIndex > -1 Then
          Range("D2") = .Value 'send combobox value to cell D2 'adjust the cell reference
        Else
          MsgBox "Found nothing"
        End If
    End Select
End With
End Sub

You need to adjust the code in this part:
VBA Code:
.List = Sheets("Sheet2").Range("Dropdown1").Value 'change sheet reference to suit
change sheet reference to where the named range "Dropdown1" is located.


I removed the linked cell and list fill range from the properties of the combobox, saved and then moved to VBA to past the code and change the name 'sheet2' to 'List'. Should it be in Keydown? There are other options. I recieved another runtime error so I thought this was my mistake, not using the correct option here, Thank you very much.



1691512511143.png
 

Attachments

  • 1691512373286.png
    1691512373286.png
    48.1 KB · Views: 6
Upvote 0
Sorry, I tested it with the "Dropdown1" was on the same sheet as the combobox.
Try this:
In VBA editor, in property window, in Tempbox4 property, you need to clear: LinkedCell & ListFillRange.
Then replace the previous code with this:

VBA Code:
Private Sub Tempbox4_Change()
With Tempbox4
    If .ListCount = 0 Then
        .List = Sheets("Sheet2").Range("Dropdown1").Value 'change sheet reference to suit
    End If
End With
Me.Tempbox4.DropDown
End Sub

Private Sub Tempbox4_GotFocus()
With Tempbox4
    .List = Sheets("Sheet2").Range("Dropdown1").Value 'change sheet reference to suit
End With
End Sub

Private Sub Tempbox4_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
With Tempbox4
    Select Case KeyCode
    Case 13 'ENTER
        If .ListIndex > -1 Then
          Range("D2") = .Value 'send combobox value to cell D2 'adjust the cell reference
        Else
          MsgBox "Found nothing"
        End If
    End Select
End With
End Sub

You need to adjust the code in this part:
VBA Code:
.List = Sheets("Sheet2").Range("Dropdown1").Value 'change sheet reference to suit
change sheet reference to where the named range "Dropdown1" is located.


This is the error. My 'List' sheet is were the named range 'Dropdown1' is.
1691512776340.png

1691512804506.png

1691512879754.png
 
Upvote 0
Could you please upload a sample workbook (without sensitive data) to a file-sharing site like Dropbox.com or Google Drive, and then share the link here? Also, ensure that the link is accessible to anyone.
 
Upvote 0
Could you please upload a sample workbook (without sensitive data) to a file-sharing site like Dropbox.com or Google Drive, and then share the link here? Also, ensure that the link is accessible to anyone.
Thank you. I am so sorry I don't know what I am doing wrong. This is my sheet with made up data. The proprietary sheet has the same issue.

 
Upvote 0
Ok, replace all previous code with this one:
VBA Code:
Private nFlag As Boolean
Private Ary
Private Sub Tempbox4_Change()
    If nFlag = False Then
        Range("d2") = Tempbox4.Value
        Call change_list
        Me.Tempbox4.DropDown
    End If
End Sub

Private Sub Tempbox4_GotFocus()

    Range("d2") = Tempbox4.Value
    Call change_list

End Sub

Sub change_list()
With Tempbox4
    Ary = Sheets("List").Range("Dropdown1").Value
            If Not IsArray(Ary) Then Ary = Array(Ary)
    .List = Ary
End With

End Sub


Private Sub Tempbox4_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
nFlag = False
With Tempbox4
    Select Case KeyCode
        Case vbKeyDown, vbKeyUp
                nFlag = True 'don't change the list if an item is selected via up-down arrow
    
        Case 13 'ENTER
            If .ListIndex > -1 Then
              Range("D2") = .Value 'send combobox value to cell D2 'adjust the cell reference
            Else
              MsgBox "Found nothing"
            End If
    End Select
End With
End Sub
 
Upvote 0
Solution
Ok, replace all previous code with this one:
VBA Code:
Private nFlag As Boolean
Private Ary
Private Sub Tempbox4_Change()
    If nFlag = False Then
        Range("d2") = Tempbox4.Value
        Call change_list
        Me.Tempbox4.DropDown
    End If
End Sub

Private Sub Tempbox4_GotFocus()

    Range("d2") = Tempbox4.Value
    Call change_list

End Sub

Sub change_list()
With Tempbox4
    Ary = Sheets("List").Range("Dropdown1").Value
            If Not IsArray(Ary) Then Ary = Array(Ary)
    .List = Ary
End With

End Sub


Private Sub Tempbox4_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
nFlag = False
With Tempbox4
    Select Case KeyCode
        Case vbKeyDown, vbKeyUp
                nFlag = True 'don't change the list if an item is selected via up-down arrow
   
        Case 13 'ENTER
            If .ListIndex > -1 Then
              Range("D2") = .Value 'send combobox value to cell D2 'adjust the cell reference
            Else
              MsgBox "Found nothing"
            End If
    End Select
End With
End Sub
Thank you for all your help! I don't see it traveling for attention to other sheets or even this one as I make changes. I appreciate your time and expertise.
 

Attachments

  • 1691520458477.png
    1691520458477.png
    83.7 KB · Views: 6
Upvote 0

Forum statistics

Threads
1,223,932
Messages
6,175,468
Members
452,646
Latest member
tudou

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