+ Reply to Thread
Results 1 to 12 of 12

coding a textbox to search in the worksheet

  1. #1
    Registered User
    Join Date
    05-21-2009
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2003
    Posts
    14

    Red face coding a textbox to search in the worksheet

    How i can encode a textbox on my userform to locate and bring all the data in the same row to the respective fields in the userform. I am working in excel 2003 vba. If you need more imformation reply me.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: coding a textbox to search in the worksheet

    You need to use the VBA .Find function to find the row, then the rest is simple.

    look at the Databaseform example here

    http://www.excel-it.com/vba_examples.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    05-21-2009
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: coding a textbox to search in the worksheet

    hi i have some question of how to adapt this to my form here is the code and image so , you that understand better can help me please, only left find by administer personel:
    first button = CommandButton1
    Previous button = CommandButton2
    Next button = CommandButton3
    Last button = CommandButton4
    save button = CommandButton5
    cancel button = CommandButton6
    add = CommandButton7
    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by castellano; 06-02-2009 at 01:31 PM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: coding a textbox to search in the worksheet

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  5. #5
    Registered User
    Join Date
    05-21-2009
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: coding a textbox to search in the worksheet

    Sorry but what is dummy workbook .i post the worksheet, i try the database form example but i receive error and highligth
    Set rng = rng.Cells.SpecialCells(xlCellTypeVisible) and .List(.ListCount - 1, 10) = c.Offset(0, 10).Text, this in Sub FindAll(). Sorry for my english.
    Last edited by castellano; 06-02-2009 at 05:05 PM.

  6. #6
    Registered User
    Join Date
    05-21-2009
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2003
    Posts
    14

    Lightbulb Re: coding a textbox to search in the worksheet

    closing................
    Last edited by castellano; 06-15-2009 at 01:35 PM.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: coding a textbox to search in the worksheet

    When you find a name your code moves the entries on the form, so the name is not displayed in ADM_PERSONNEL as expected.

    Rn Debug and you will find an unnecessary End If

  8. #8
    Registered User
    Join Date
    05-21-2009
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2003
    Posts
    14

    Question Re: coding a textbox to search in the worksheet

    i correct the end if . but the lisbox is clear when i try to use the find button and again moves the entries on the form. Receive an error message, using the debug button send me to the line 152, col 60 "Set rng = rng.Cells.SpecialCells(xlCellTypeVisible)". What can be the solution to put the userform functional

  9. #9
    Registered User
    Join Date
    05-21-2009
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: coding a textbox to search in the worksheet

    Can you view my project again and help me create a link between the find button and the listbox so that i can chose what record of the adm personnel to updated.
    Last edited by castellano; 06-15-2009 at 01:33 PM.

  10. #10
    Registered User
    Join Date
    05-21-2009
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2003
    Posts
    14

    Wink Re: coding a textbox to search in the worksheet

    ......................
    Last edited by castellano; 06-15-2009 at 01:33 PM.

  11. #11
    Registered User
    Join Date
    05-21-2009
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2003
    Posts
    14

    Cool Re: coding a textbox to search in the worksheet

    ....................
    Last edited by castellano; 06-12-2009 at 03:10 PM.

  12. #12
    Registered User
    Join Date
    05-21-2009
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2003
    Posts
    14

    Arrow Re: coding a textbox to search in the worksheet

    Thank that example that you give me save my live all this is closing...........

+ 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