Consulting

Results 1 to 2 of 2

Thread: Retrieve value based on selection

  1. #1
    VBAX Newbie
    Joined
    Jan 2017
    Posts
    1
    Location

    Retrieve value based on selection

    Hi all,

    relatively new to VBA and am working on a small project to create a form that once filled out and ran will create an e-mail to the appropriate people. I already know how to generate e-mails from a previous project and am looking for help to solve this particular problem.

    I have 2 sheets. First sheet contains the ordering options and the second is a table of projects and associated vendors and relative numbers.

    Sheet 2
    Project Name Project Number Main Vendor Vendor A Vendor B e-mail
    Project 1 123 Vendor A 8j2s0f
    Project 2 456 Vendor B ms02jn4
    Project 3 789 Vendor B dimo29
    -Column 3 states which vendor is used and in correct column a unique string is presented which I would like to extract for my email
    -Columns 3, 4 & 5 are laid out this way because I also use Sheet 2 as a reference for doing other things. Otherwise I would just put the unique string in a cell in the row for that respective project.

    Sheet 1 is still in the works but roughly looks like this....
    Project Name: (data validation drop down)
    Vendor: This is where I would like the vba code to automatically retrieve the appropriate vendor from Column 3 based on the Project Name selected above
    String: Retrieve the corresponding string for project
    Order: a list of things i will be ordering

    There a few other things in the form but I have got them worked out for the most part.

    Anything helps!

    Thanks in advance.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Welcome to the forum!

    I suspect that a simple attached file might make it easier to help. Maybe it is simply?
    MsgBox Selection.Offset(,2).value

Tags for this Thread

Posting Permissions

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