+ Reply to Thread
Results 1 to 3 of 3

Populating Textbox base on Combobox value from another work book

  1. #1
    Registered User
    Join Date
    04-09-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    54

    Thumbs up Populating Textbox base on Combobox value from another work book

    Hi guys ! i am seeking advice on vba to PopulateTextbox base on Combobox value from another workbook

    Both combobox and textbox DATAs are from the other workbook. just different column.


    Happen to be like a vlookup function which allows me to check what the changes in value of combobox then automacially change as well.


    Worksheet1.xlsm
    Databasenames.xlsx

    Here are the two files , databasenames will be the data for the combobox and textbox data will be at.
    and worksheet1 file is the user form. Regarding the combobox is already done . right now is only the text box.
    Thanks in the advance !! cheers !
    Last edited by andywsw; 04-25-2012 at 02:52 AM.

  2. #2
    Registered User
    Join Date
    04-09-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Populating Textbox base on Combobox value from another work book

    i being looking through the web , found is mostly is for MS access. And some of the related excel search is not helping with the codes =S

  3. #3
    Registered User
    Join Date
    04-09-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Populating Textbox base on Combobox value from another work book

    Private Sub ComboBox1_Change()
    TextBox1.Value = CostCenter(ComboBox1.Value)
    End Sub

    Public Function CostCenter(StaffName) As String
    With Worksheets("CostCenterSheet").Range("A:A")
    Dim C as Variant
    Set C = .Find(StaffName, LookIn:=xlValues, lookat:=xlWhole)
    If Not C Is Nothing Then
    CostCenter = C.Offset(0, 1).Value
    Else
    CostCenter = "Not Found"
    End If
    End With
    End Function


    Just to share my solution i found =D http://www.mrexcel.com/forum/showthread.php?t=64735< source

+ Reply to Thread

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