![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 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 |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
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 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|