automatically populate with values from another workbook

The Grim Discovery

Board Regular
Joined
Jan 23, 2015
Messages
241
Office Version
  1. 365
Platform
  1. Windows
Hiya

Could anyone help me to try and do the following.

I'm working across two worksheets in separate workbooks. The first looks like this.

Workbook 1: Team nameMonthly Points total
Tottenham45
United41
City
48
Arsenal31
Burnley30
Liverpool42

<tbody>
</tbody>


While in the second workbook I've got the same teams but in alphabetical order. I'm trying to get the monthly Points total to 'automatically' populate in the second column of the workbook based on the figures from workbook 1. How can I do this? And I'm looking to do for a much larger number of cases, not just the six here.
Lots of thanks in advance.
Workbook 2: Team namePoints total
Arsenal
Burnley
City
Liverpool
Tottenham
United

<tbody>
</tbody>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Do you want to update workbook2 automatically as you enter each point total in workbook1? In other words, when you enter 45 points for Tottenham, the points are automatically entered in workbook2 for Tottenham.
 
Last edited:
Upvote 0
Do you want to update workbook2 automatically as you enter each point total in workbook1? In other words, when you enter 45 points for Tottenham, the points are automatically entered in workbook2 for Tottenham.

If that's possible I would.
 
Upvote 0
Copy and paste this macro into the worksheet code module. Do the following: In Workbook1, right click the tab for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Change the workbook name and the sheet name in the code to suit your needs. Close the code window to return to your sheet. Save Workbook1 as a macro-enabled file. Make sure that Workbook2 is open. In Workbook1, enter a value in column B and exit the cell. Workbook2 will have been updated.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("B:B")) Is Nothing Then Exit Sub
    Dim foundTeam As Range
    Set foundTeam = Workbooks("Workbook2.xlsx").Sheets("Sheet1").Range("A:A").Find(Target.Offset(0, -1), LookIn:=xlValues, lookat:=xlWhole)
    If Not foundTeam Is Nothing Then
        foundTeam.Offset(0, 1) = Target
    End If
End Sub
 
Upvote 0
You are very welcome. :)
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,323
Members
449,218
Latest member
Excel Master

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