Results 1 to 3 of 3

Thread: excel problem.....

  1. #1

    Thread Starter
    Hyperactive Member Greyskull's Avatar
    Join Date
    Dec 2003
    Location
    somewhere in England
    Posts
    382

    Question excel problem.....

    i've got a list of names in column A:H and i want a textbox and a commandbutton that can be used to search the list of items I've got in column A
    i.e. In column A I've got a list of computer brands and by using the search button it will show the results that match up on columns I:O

    Can anyone show me a code for this if it is possible to do.

    Thanx for ur time,
    Greyskull

  2. #2
    Addicted Member
    Join Date
    Dec 2001
    Posts
    158
    I can't picture what you are trying to do at all.

    Can you upload a small example sheet or something?


    Column A has computer brand names
    Columns B:H have.... ?
    Columns I:O have.......?

    What is matching what?

  3. #3
    Member
    Join Date
    May 2004
    Location
    Dubai, United Arab Emirates
    Posts
    33
    Hi,

    I don't understand why would you need a Textbox and a commandbutton to do this.

    Put this code on a button and it will do for you.



    Sub FindThis()
    Dim MyValue, MyFindNext
    [A1].Select
    MyValue = InputBox("What Would you Like To Search.", "Company Name")

    On Error GoTo err_Trap
    Cells.Find(What:=MyValue, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
    xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate

    MyFindNext = vbYes
    Do Until MyFindNext <> vbYes
    MyFindNext = MsgBox("Would you like to find the next instance of " & MyValue & "?", _
    vbYesNo, "Find Next")
    If MyFindNext = vbNo Then
    Exit Sub
    End If
    Cells.FindNext(After:=ActiveCell).Activate
    Loop
    On Error GoTo 0
    Exit Sub

    err_Trap:
    If Err.Number = 91 Then
    MsgBox "Could not find " & MyValue & " anywhere on this sheet.", , "Unsuccessful search"
    Else
    MsgBox Err.Number & ": " & Err.Description
    End If
    End Sub




    Best Regards,

    S h a n

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width