Search box that allows you to start typing and it will autofill the answer matching file names

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,352
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a spreadsheet that I want to have something that allows me to start typing a name and it will auto fill as I type to match the name typed with the names on other spreadsheets that are kept in a folder called Young People that is within the folder of the spreadsheet. I am not sure how to do this, could someone give me some guidance please?

After enough letters are typed in and the correct name appears, I want to be able to press a button and have the relevant document open.

Thanks
 
Thanks Michael but I think I need to have a button to execute it, so I can work out how to do that.
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
So just add a button...when the data has been entered into the combo box correctly the button macro will be something like
VBA Code:
If ComboBox1.Value <> "" Then
'add your code
End If
 
Upvote 0
Thanks Michael, I got it to work with this code and it is called from a command button.
VBA Code:
Sub AddYP()
Dim NewYP As String

NewYP = Tracker.Cells(5, 4)
YP.Range("A" & Rows.Count).End(xlUp).Offset(1, 0) = NewYP
    
End Sub
 
Upvote 0
Actually, I do want to get it working if I press enter.

I added code to the sheet module that has the combo box
VBA Code:
Private Sub cboYP_Change()
Call AddYP
End Sub

I am pressing enter when the right item is selected but nothing is happening.
 
Upvote 0
Did you assign the macro to the comboBox ?
It must be an ActiveX comboBox
VBA Code:
Private Sub ComboBox1_Change()
'your code
Endd Sub
 
Upvote 0
That is what the code in post 24 does. It is also a activex combo box.
 
Upvote 0
Excel back on line....It works fine for me !!
 
Upvote 0
Any ideas of things I could check on my end as pressing enter does nothing for me?
 
Upvote 0
You shouldn't have to press Enter !!
Once the comboBox is changed it runs automatically !
 
Upvote 0
It runs Ok for me....but the combobox calls AddYp Not Openfile !!
I alos note you don't have a ListFill range in the ListBox !!
 
Upvote 0

Forum statistics

Threads
1,215,248
Messages
6,123,877
Members
449,130
Latest member
lolasmith

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