Retrieve data from different worksheet thru combo box contro

workin2def

New Member
Joined
Mar 4, 2002
Messages
3
hey all. got a prob
I have create a combo box on sheet1 of workbook that list unit names from a column on sheet3. Sheet2 is a database of names, badge numbers, and coinciding unit names for each listing. I am having problems coding to my excel that I want to choose from the combo box and as a result I want the data from sheet2 for that unit name to display on sheet1 in a selected field. I am trying it in sql and vb but running into errors. Can ya give me some insight? thanks
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try some code like this:


Private Sub ComboBox1_Change()
Dim strLookFor As String
If ComboBox1.ListIndex > -1 Then
strLookFor = ComboBox1.Text
With Sheet3.Range(ComboBox1.ListFillRange)
Range("A1") = .Find(What:=strLookFor, After:=.Cells(1, 1), _
LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=True).Offset(0, 1)
End With
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,218
Members
448,554
Latest member
Gleisner2

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