run vb-application to search string in the table to "score"

vic_it

New Member
Joined
Apr 10, 2024
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
I have 3 tables:

Table1- for First data (dynamic data, get from other sheet)
Table2- Reference to get "score"
Table3- Final result "score"

We need to read first var in Table2, compare with first var in Table1, then do some compare like folowwing (I have them inside sheet attach)

Step 1 Read Var1-Table2
Step 2 Compare with Var1-Table1
Step 3 if its true, compare with small Table 1-Xn (n choose only 1 value from 1 to 4)
Step 3-1 Compare with Table 2
Step 3-2 If result same table1- same Row - print with Table2-result1
Step 3-3 If result same table1- other Row - print with Table2-result2
Step 3-4 Final result write to Table 3 (final result)
Step 4 If it not true, write to 0 to Table3, return Step1, do loop to the End


For example, after run vba, when Apple in Table1-X2, loop run for Table1-X2 (row 4-6), meet Banana in other row, final result = 1 in table3

Request-v0.1.xlsx
ABCDEFGHIJKLMNO
1
2Table1-First data
3Table1-Var1
4
5Table1-X1 (row1-3)
6
7
8AppleTable1-X2 (row4-6)
9Banana
10
11Table1-X3 (row7-9)
12
13PeachCherry
14Table1-X4 (row10-12)
15
16
17
18Table2- Mixed
19Same table1-X ~ same RowSame table1-X ~ other Row
20Table2- var1Table2-result1Table2-Result2Table3-Final result
211AppleBanana211
222AppleBananaGrape43
233AppleMango-20
244AppleMangoStarfruitpapaya-4-2
255
266
27
28Peachcherry323
29Peachcherrycoconut54
30
31
32
33n
Sheet1




Can someone help me for do by vba ? Thank a lot.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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