Results 1 to 10 of 10

listbox to combobox

Threaded View

  1. #1
    Registered User
    Join Date
    08-11-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    11

    listbox to combobox

    Hi guys,

    I've found this bit of code that I'd quite like to use but rather than having the values show up in a listbox, I'd like them to be selected from a combobox.

    Can someone provide assistance please?

    Thanks,

    Dom

    Private Sub ListBox1_Click()
        Dim vreg As String, drow As Integer, c As Range
    
        Let vreg = ListBox1.Value
    
        With Sheets("sheet1").Range("C2:C100")
            Set c = .Find(vreg, LookIn:=xlValues, lookat:=xlWhole)
            If Not c Is Nothing Then
                 drow = c.Row
            End If
        End With
    
        With Me
            .txtFName.Value = Sheets("sheet1").Cells(drow, 1).Value
            .txtLName.Value = Sheets("sheet1").Cells(drow, 2).Value
            .txtsb.Value = Sheets("sheet1").Cells(drow, 3).Value
            .txtloan.Value = Sheets("sheet1").Cells(drow, 4).Value
            .txtopen.Value = Sheets("sheet1").Cells(drow, 5).Value
            End With
        End Sub
    Last edited by dcompagnone; 08-12-2010 at 04:16 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1