+ Reply to Thread
Results 1 to 7 of 7

Search function code refinement

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Search function code refinement

    Hi all,

    Im a novice when it comes to macro's VBA etc so I would appreciate some guidance please.

    I run a small service department. We have a number of bins containing various parts. Im trying to design an excel sheet that will allow engineers to search for a particular part by description or number and to be shown the relative bin number as a result.

    I have searched the net for relevant code and have got pretty close to what I need. However, the search code im using returns the cell reference containing the relevant part number. What I need it to do is return the "bin reference". I have tried naming cell ranges (on the attached example only the first 4 are named) but im unable to modify the button code to return the bin reference as a result.

    If anyone could please have a look at my code and let me know what I need to do I would appreciate it.

    Thanks

    Please Login or Register  to view this content.
    Test.xlsm

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Search function code refinement

    try
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-18-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Search function code refinement

    Thank you my friend!

    That is exactly what I wanted to do....

    I do have one small question though, if I may. When a reference is found the messagebox puts the reference on a new line instead of inline (such as the "unable to find" message. Is there a reason for this or can I make them both inline easily?

    Thanks again for your help

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Search function code refinement

    Try to change this line
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-18-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Search function code refinement

    Thank you again for your help, that has done the trick.

    Going back to the original idea, where there is a vertical list of bin references produced, how easy would it be to display the complete data (whole part number, not just the seached part) from the the relevant cell on the same line as the bin reference.

    ie so the pop up window looks something like:

    Bin Location:
    B14: Part number:123555

    rather than

    Bin Location:
    B14

    Thanks again, i promise no more questions after this one (not on this subject anyway)

    Im trying to understand the code involved in this but it is still somewhat of a mystery

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Search function code refinement

    Just append this line
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-18-2012
    Location
    Kent, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Search function code refinement

    Thats exactly what I need.

    I would give you more rep but the system wont allow me.

    Thanks again for all your help, its really appreciated. Now all I have to do is try and understand how it does it

+ 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