+ Reply to Thread
Results 1 to 5 of 5

Code for searching a worksheet and displaying results in a form for editing

  1. #1
    Registered User
    Join Date
    02-22-2012
    Location
    Rotorua, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    15

    Code for searching a worksheet and displaying results in a form for editing

    Hi All

    I am trying out some codes to create some interactive forms for my work.

    Can someone help me with a code to perform the following

    I have a Userform called SEARCH. I would like the user to enter a date into a textbox (TextBox1) on this form and hit enter. I then would like the code to search down column A in a worksheet called Sheet1 for that date (there ought to be only one entry with that date). I would then like a second userform called EXPERIMENTAL to be populated with data from the row that contains the searched for date. In this case the data I want displayed as follows - Result from Column A on sheet1 (ie the date) to be displayed in TextBox called DAT2 - Column B on sheet 1 in text box called EXP and Column D on sheet1 in a text box called EXP2.

    I would be grateful for any help.
    Cheers
    Ross
    Last edited by RossN; 02-22-2012 at 11:40 PM.

  2. #2
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Code for searching a worksheet and displaying results in a form for editing

    If you could upload a sample workbook with your existing forms, that would be very helpful. Thanks!
    -Greg If this is helpful, pls click Star icon in lower left corner

  3. #3
    Registered User
    Join Date
    02-22-2012
    Location
    Rotorua, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Code for searching a worksheet and displaying results in a form for editing

    Hi, Thanks for the reply. I have attempted to attach the file in its simplest version. If you can show me how to make this one work, I will be able to extrapolate that to the more complex version I am creating.

    Micro Ab QC forms TEST.xls

    Cheers
    Ross

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Code for searching a worksheet and displaying results in a form for editing

    Hello Ross,

    Welcome to the Forum!

    Here is the code for the "Find" button on the "Search" form.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Registered User
    Join Date
    02-22-2012
    Location
    Rotorua, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Code for searching a worksheet and displaying results in a form for editing

    Sorry for slow reply - I've been away for a few days.

    Many Thanks for your reply! The code works great when I apply it to my more complex working forms.

    I will continue working on them for the next week or two. I suspect there may be one more area of code that I may need assistance with but will post that later

    Again Many Thanks

    Ross

+ 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