automatically populate with values from another workbook

The Grim Discovery

Board Regular
Joined
Jan 23, 2015
Messages
246
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.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Workbook 1: Team name[/TD]
[TD]Monthly Points total [/TD]
[/TR]
[TR]
[TD]Tottenham[/TD]
[TD]45[/TD]
[/TR]
[TR]
[TD]United[/TD]
[TD]41[/TD]
[/TR]
[TR]
[TD]City
[/TD]
[TD]48[/TD]
[/TR]
[TR]
[TD]Arsenal[/TD]
[TD]31[/TD]
[/TR]
[TR]
[TD]Burnley[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]Liverpool[/TD]
[TD]42[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


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.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Workbook 2: Team name[/TD]
[TD]Points total [/TD]
[/TR]
[TR]
[TD]Arsenal[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Burnley[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]City[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Liverpool[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Tottenham[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]United[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
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

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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