Find cell from textbox input

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wanderlust
    New Member
    • Feb 2010
    • 4

    Find cell from textbox input

    I've just started trying to code in VB6 and need a little help please....

    When user enters tel number in textbox, what code do I need which will search for that number (in a particular column) in Excel. I need this so I can populate other text boxes in my form with the remaining cells' data in that row.

    Hope this makes sense. Any help would be appreciated.
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    dear,

    I hope this will help:

    Code:
    Private Sub CommandButton1_Click()
       Worksheets("Sheet1").Activate
       Range("A1").Activate
       Do While ActiveCell.Value <> ""
          If ActiveCell.Value = TextBox1.Text Then TextBox2.Text = ActiveCell.Offset(0, 1)
          ActiveCell.Offset(1, 0).Activate
       Loop
    End Sub

    see also attachment for an example.


    br,
    Attached Files

    Comment

    • wanderlust
      New Member
      • Feb 2010
      • 4

      #3
      Thanks for the help Guido. Did you get my PM?

      Comment

      • Guido Geurs
        Recognized Expert Contributor
        • Oct 2009
        • 767

        #4
        dear,

        In your PM is only a link to:

        C:\Documents and Settings\Owner\ Desktop\test.zi p

        This is no link to a file on BYTES.

        If you want to set a file on the server, you have to go to the call and klick on : "Post replay"
        There you can attach a file by clicking on the button "Manage Attachments"
        Browse to your ZIP file wich is on :

        C:\Documents and Settings\Owner\ Desktop\test.zi p

        Click on "Upload"
        Now the file is on the BYTES server from where I can download it.
        Click on "Close this window" on the bottom of the page.

        Now you are back on the "post replay" page and click on "Submit reply" to send it to me.

        br,

        Comment

        • wanderlust
          New Member
          • Feb 2010
          • 4

          #5
          Oops

          Hi again

          Thanks for that. You can probably tell I've never uploaded on forums before!!!

          Hope you get this ok.
          Attached Files

          Comment

          • Guido Geurs
            Recognized Expert Contributor
            • Oct 2009
            • 767

            #6
            dear,


            Is this what you want? (see attachment)


            br,
            Attached Files

            Comment

            • wanderlust
              New Member
              • Feb 2010
              • 4

              #7
              ggeu - Your the BEST!

              Thanks so so much. That's EXACTLY what I was after. This is a big help.

              Comment

              Working...