+ Reply to Thread
Results 1 to 2 of 2

vb find code to find values from specific columns in excel and upload values of same row

  1. #1
    Registered User
    Join Date
    04-19-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question vb find code to find values from specific columns in excel and upload values of same row

    vb find code to find values from specific columns in excel and upload values of same row to text box1 to textbox9 and combobox 1 of vb form
    my cod is

    Private Sub btnFind_Click()
    Dim sFindIt As String, lRowFnd As Long

    sFindIt = Application.InputBox(prompt:="Please enter search criteria:")
    If sFindIt = "False" Or sFindIt = vbNullString Then Exit Sub
    With Worksheets("Sheet2")

    On Error Resume Next
    lRowFnd = .Cells.Find(What:=sFindIt, After:=ActiveCell, LookIn:=xlValues, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, _
    SearchFormat:=False).Row

    If Err <> 0 Then
    MsgBox "Search Criteria - " & sFindIt & " - Was Not Found", vbExclamation: Exit Sub
    End If
    On Error Goto 0


    TextBox1.Value = .Cells(lRowFnd, 1).Value
    TextBox2.Value = .Cells(lRowFnd, 2).Value
    TextBox3 = .Cells(lRowFnd, 3).Value
    TextBox4.Value = .Cells(lRowFnd, 4).Value
    TextBox5.Value = .Cells(lRowFnd, 5).Value
    TextBox6.Value = .Cells(lRowFnd, 6).Value
    TextBox7 = .Cells(lRowFnd, 7).Value
    TextBox8 = .Cells(lRowFnd, 8).Value
    TextBox9 = .Cells(lRowFnd, 9).Value
    ComboBox1 = .Cells(lRowFnd, 10).Value




    End With
    End Sub
    Its Show result that first value match in worksheet But I want to find value from only Column "A" Please Any one can help me

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: vb find code to find values from specific columns in excel and upload values of same r

    Hi,

    Please Login or Register  to view this content.
    Regards
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

+ 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