VBA - Max Values and Match

adamscourfield

New Member
Joined
Nov 28, 2019
Messages
7
Office Version
  1. 2010
Platform
  1. MacOS
Hi all,

I am stuck on a problem. I have need to insert a vba macro into a sheet for my admin team. I want to find the highest value from a range in one sheet and return the value to another sheet if the adjacent column matches. I also want it to return it to the next blank cell in that row. So...the highest score for Name 1 in sheet 2 would go into the next black row in column B for that name. Any help would be greatly appreciated.

Sheet 1
A B
Name 1. SCORE
Name 2. SCORE
Name 3. SCORE
Name 4. SCORE

Sheet 2
A B
Name 1. 1
Name 1. 10
Name 1. 8
Name 2. 7
Name 2. 6
Name 3. 5
Name 3. 4
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
It can be with the following array formula.

varios 09jul2020.xlsm
AB
1NAMESCORE
2Name 110
3Name 27
4Name 35
5Name 40
Sheet1
Cell Formulas
RangeFormula
B2:B5B2=MAX((Sheet2!$A$2:$A$8=A2)*(Sheet2!$B$2:$B$8))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

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