Retrieve data from different worksheet thru combo box contro
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Retrieve data from different worksheet thru combo box contro

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    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. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    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

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com