+ Reply to Thread
Results 1 to 13 of 13

Open workbook based on value found in range

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Open workbook based on value found in range

    Good morning, Gurus.

    I am trying to open a specific workbook, from several books on a shared drive, based on a value found in a range of cells.

    For example, range A3:B3 will contain a number, and cmay also contain some text, but based on the number found in that range, I want to open or activate a particular workbook.

    Let me know if further clarification is required.

    Thanks in advance.

    Jerry

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    What is actually in the cells? Attach an example.
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Example

    Morning, Roy.

    The attached workbook contains 2 example of the types of responses I may find in row 3 of the worksheet titled "Quantity Changes". Some of the suppliers are putting the supplier number in cell B3 of the worksheet, but some are putting it in A3, along with the row header, "Vendor #:". Thats the only reason I need to search for the number. I figured if I could search for the number, it would save me having to make the suppliers change their programming again.

    The workbook is attached and, as always, I appreciate your expertise.

    Hutch
    Attached Files Attached Files
    Last edited by hutch@edge.net; 06-11-2008 at 10:36 AM. Reason: Forgot attachment

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Is the workbook to open the same named with the number entered?

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    If it helps...

    I haven't built the workbooks yet, but I'm thinking they will be named "PO Response Tracking - 014619", "PO Response Tracking - 010299", etc.

  6. #6
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Bump...

    Good morning, All.

    This is just a bump to get back to the top of the list.

    Any suggestions appreciated.

    Thanks.

  7. #7
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Can't be done...

    I'm guessing that if the mods on this site don't know how to do it, it can't be done.

    Back to the drawing board, I guess. Thanks anyway.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You need to lock cells that you don't want suppliers to enter into & make sure the data entered is in the correct format. this will make processing much easier.

  9. #9
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Heres the problem...

    I agree with your sentiments, Roy, but here's my problem. The forms I am receiving are being sent by over 100 suppliers. The smaller ones may be simply entering information into the template I sent, but most of the larger ones are dumping the text file sent by the buyer into their system, and IT has programmed their system to output it in our format. It has been such a hassle getting everyone on the same page up to this point, I thought it would be easier to allow for errors on my end than to get them all to maintain compliance on their end.

    The numbers I am "searching" for and trying to use to open another workbook are the individual supplier numbers. Most of them have this number listed in cell B2, and "Vendor #:" in A2, but some of them have "Vendor #: 112345" listed in A2. Also, since some vendor numbers begin with "0", Excel usually leaves the "0" out of the number, because they didn't format the cell as text prior to entering the number. This is why I was wanting to search the contents of that range to look for the number, and then open the appropriate book based on the number found.

    Alas, too many variables can ruin even a good code, so unless you know of a potential solution, I'll have to start working with the suppliers to try and get a standard output from each of them.

    Thanks again for all your time.

    Hutch

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    See if this selects the right number, let me know 7 then we can add code to open the workbook.

    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Results

    S'up, Roy?

    There was an error. I changed the "End if" at the end of the sub to an "End with", and it ran.

    Please Login or Register  to view this content.
    The contents of cells A2:B2 on the sheet I ran it on were:
    A2 B2
    Vendor #: 13730

    The message bos that appeared said - "dor #:", so it trimmed out the first 3 letters of A2.

    When the contents of cell A2 is changed to:
    Vendor #: 13730

    The message box showed 13730, so apparently it works in some cases.

    Thanks for trying!

  12. #12
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Value of CELL?

    S'up, Gurus?

    I'm working with the suppliers to get them all in the smae format, which means I will be able to use the value of a CELL rather than a range to find which workbook to open.

    Cell B2 will contain the vendor number. The workbook I want to open will be on a network drive, and will be titled:
    Please Login or Register  to view this content.
    What's the proper syntax to open that file?

    Thanks.

  13. #13
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Got it...

    Nevermind. The syntax I was looking for was :
    Please Login or Register  to view this content.
    Have a good one!

+ 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