+ Reply to Thread
Results 1 to 10 of 10

Creating a Search Command Button (Macro)

  1. #1
    Registered User
    Join Date
    02-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Creating a Search Command Button (Macro)

    Hi Guys,
    I am computer literate, however my knowledge of excel is limited, so bear with me. I am trying to create a uniform stock database for my company. Thus far, I have 2 worksheets. The first is a face sheet, for the user to interact with. This face sheet has a number of drop down menus on it allowing them to select "Type" and "Size" of the item they need. This information is then translated (by a hidden table) into an item code.
    The second sheet contains a list of all the uniform items currently in stock. Each item has its individual code that correlates to the code the face sheet generates.
    My question is regarding a search macro.
    I want the user to be able to click a command button on the face sheet, labelled "search". This would then take the generated "Item Code" and search for it on the second worksheet. I am aware that it would be very easy for them to simply copy the code into "find" on the second sheet, however it needs to be as easy and quick to use as possible.
    Any help would be greatly appreciated. Thanks[/SIZE][/SIZE][/SIZE]
    Last edited by arlu1201; 03-18-2013 at 01:22 AM.

  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: Creating a Search Command Button (Macro)

    An example workbook would help
    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
    02-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Creating a Search Command Button (Macro)

    Thanks for the reply mate. I have attached an example sheet.

    What im looking for is a macro that copies the item code from the first sheet and searchs for that code on the second sheet.

    Thanks for the help
    Attached Files Attached Files

  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: Creating a Search Command Button (Macro)

    Why do you need a macro/ You could use VLOOKUP?

  5. #5
    Registered User
    Join Date
    02-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Creating a Search Command Button (Macro)

    I could use VLookup if i knew what that was, if you could implement Vlookup into that sheet i would be able to work it out.

    Is it really hard?

    Thanks

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

    Re: Creating a Search Command Button (Macro)

    VLOOKUP is fine, but I really should point out to you and others - explore Excel's built in features before venturing into VBA.

    Read up on VLOOKUP - this should help http://www.excel-it.com/excel_functions.htm
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-05-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Creating a Search Command Button (Macro)

    Thanks for all your help mate

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

    Re: Creating a Search Command Button (Macro)

    If you are satisfied with the solution(s) provided, please mark your thread as Solved and rate the answer.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  9. #9
    Registered User
    Join Date
    03-14-2013
    Location
    Providence
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: (Solved) Creating a Search Command Button (Macro)

    My first post here sorry if Im not following the rules. I have created a userform in excel where user's enter a range of data (name and vehicle information). I have set this up where each entry is assigned a number. Is there a way I can create a userform where users can enter either the number or name to show the results of the data (if it's in there) if not msbox "no data found". Thanks in advance for help on this topic.

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: (Solved) Creating a Search Command Button (Macro)

    kconti,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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