+ Reply to Thread
Results 1 to 6 of 6

vba to use vlookup on two ranges

  1. #1
    Registered User
    Join Date
    11-03-2021
    Location
    Devon, England
    MS-Off Ver
    office 365
    Posts
    11

    vba to use vlookup on two ranges

    Hi

    I am having trouble finding a solution and i hope you guys can help.
    i have a workbook that i need to automate the population of a name on the overview sheet based on a specific character placed in a range. the overview is split in to 3 following sheets i want to cross reference the charaacter 'R' with the headerr/1st row in the named range, match with the named rang on the overview and extract the corresponding name, then paste in to the resposible column on the matching line on the overview
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: vba to use vlookup on two ranges

    You really need to explain what you want with specific examples and names of ranges and addresses of cells, along with examples of input values and expected outputs.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    11-03-2021
    Location
    Devon, England
    MS-Off Ver
    office 365
    Posts
    11

    Re: vba to use vlookup on two ranges

    Quote Originally Posted by Bernie Deitrick View Post
    You really need to explain what you want with specific examples and names of ranges and addresses of cells, along with examples of input values and expected outputs.
    Sorry i have filled in the stakeholders section at the bottom of the first Sheet, and the first two lines of the resposible section along with the first 2 lines of the second sheet named 1.planning.
    where the zeroes are relate to the sheet the responsible person need to be copied from. what i want it to do is :

    1. find the 'R' on the RACI matrix
    2. cross reference with the header to find the stakeholder from the section at the bottom of the sheet.
    3. find the relative line on the overview sheet
    4. Find the correct row using the project managment column
    5. paste the name in the responsible column based on the project management column.

    I will probably use a command button to update once a section has been updated but am open to ideas on easier ways to manage the updating

    Hope this is a bit clearer
    Attached Files Attached Files

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: vba to use vlookup on two ranges

    I have tried to understand what you are trying to achieve, all be it with some difficulty.
    I can not see how the headers can be referenced as there does not seem to be corresponding name in lists.
    However I will step aside from this as I do not involve myself with apps that use merged cell within data referencing areas.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  5. #5
    Registered User
    Join Date
    11-03-2021
    Location
    Devon, England
    MS-Off Ver
    office 365
    Posts
    11

    Re: vba to use vlookup on two ranges

    Fair enough, Thanks for looking for me

  6. #6
    Registered User
    Join Date
    11-03-2021
    Location
    Devon, England
    MS-Off Ver
    office 365
    Posts
    11

    Re: vba to use vlookup on two ranges

    I have come back to this and converted the sections that need refering to into tables and worked out the logic that i think the vba needs to follow. the cell references i have filled in manually so there is a representation of the data that i need to be populated, i just have no idea where to start writing the code. the following is the logic i think it needs to follow and i have re-uploaded the document:

    Sheet "1.Planning" go to second row of "RACIplan" table (C13) and search row for "R"
    when found Check row 11 for value of matching column (cell F11 "Product Manager")
    sheet "Overview" find previous match ("Product manager") in range "RACI_Stakeholders" (C131:D141 "Product Manager") offset 1 column and copy name ("Doug")
    Sheet "1.Planning" go to second row of "RACIplan" table (C13) and match value in column 1 ("Generate business case") to sheet "Overview" Table5 column 1 (C23) offest 5 columns paste copied value ("Doug") to column (cell G23)
    loop for each row in sheet "1.Planning"

    Sheet "2.Execution" go to Third row of "RACIexec" table (C13) and search row for "R"
    when found Check row 11 for value of matching column (cell G11 "Product Manager")
    sheet "Overview" find previous match ("Product manager") in range "RACI_Stakeholders" (C131:D141 "Product Manager") offset 1 column and copy name ("Doug")
    Sheet "2.Execution" go to Third row of "RACIexec" table (C13) and match value in column 1 ("Update business case") to sheet "Overview" Table5 column 1 (C33) offest 8 columns paste copied value ("Doug") to column (cell J33)
    loop for each row in sheet "2.Execution"

    Sheet "3.Finalizing" go to Third row of "RACIfin" table (C13) and search row for "R"
    when found Check row 11 for value of matching column (cell G11 "Product Manager")
    sheet "Overview" find previous match ("Product manager") in range "RACI_Stakeholders" (C131:D141 "Product Manager") offset 1 column and copy name ("Doug")
    Sheet "2.Execution" go to Third row of "RACIfin" table (C13) and match value in column 1 ("Update business case") to sheet "Overview" Table5 column 1 (C33) offest 11 columns paste copied value ("Doug") to column (cell M33 )
    loop for each row in sheet "3.Finalizing"

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. vlookup to different ranges
    By burgie10 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-20-2015, 06:37 AM
  2. [SOLVED] Vlookup from set ranges - one below the other
    By tsioumiou in forum Excel General
    Replies: 3
    Last Post: 07-09-2012, 06:03 PM
  3. Two ranges and vlookup????
    By dufusko in forum Excel General
    Replies: 8
    Last Post: 02-10-2012, 09:59 AM
  4. VLookup with ranges
    By Thorxes in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-29-2008, 05:40 PM
  5. Vlookup- Ranges
    By meggles in forum Excel General
    Replies: 7
    Last Post: 06-03-2008, 07:50 AM
  6. vlookup with Name Ranges
    By mark_fairfield in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2007, 10:27 AM
  7. VLOOKUP across 2 ranges
    By katzeye in forum Excel General
    Replies: 1
    Last Post: 04-03-2007, 02:15 PM

Tags for this Thread

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