VBA to Get Output by check relations from Input

Smerdis13

New Member
Joined
Nov 15, 2023
Messages
11
Office Version
  1. 2016
Platform
  1. Windows
Hi Guys,
i know title is confusing so i start with the example:
I Have one Workbook which in "Input" Sheet i input names and Output is for example for one name is:
Row1: "Jack" "Walks" "to Catch" "MAN UNITED" "Tshirt"
Row2: "Jack" "Walks" "to Catch" "BARCELONA" "Tshirt"
How:
1- Input Name in "Input" Sheet then check with Vlookup from "Dictionary" for "Relation = Father" and "Family = Family1"
2-then in "Action" Sheet search only for "Family" in Column A (Type)
3-then for "Relation" Type from "Input" Sheet, search in "Action" sheet in Column J (Main Relation)
4-then for the exact "Target Relation" in Column I in "Action" Sheet and exact "Family" in "Input" sheet in Column I , search in "Relations" Sheet for column E (Target Fav Team)
5-then based on this structure, output will be made:
Sheet "Input".Range C & Sheet "Action".Range B & Sheet "Action".Range D & Sheet "Dictionary".Range D & Sheet "Action".Range H

Row1: "Jack" "Walks" "to Catch" "MAN UNITED" "Tshirt"
Row2: "Jack" "Walks" "to Catch" "BARCELONA" "Tshirt"

Another Example:
IF Input is: "Hannah"

Row1: "Hannah" "Drives" "to Catch" "REAL MADRID" "Tshirt"
Row2: "Hannah" "Runs" "to Buy" "JUVENTUS" "Video"
Row3: "Hannah" "Runs" "to Buy" "ARSENAL" "Video"
Row4: "Hannah" "Runs" "to Buy" "CHELSEA" "Video"

If INPUT is more than one names, Output should in sequence for each name after the other

Excel File:

Thanks in advance
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I would recommend using the forums Excel Add-In to share your table data for other to help you better.
best regards,
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,963
Members
449,094
Latest member
Anshu121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top