Picking and copying data from another sheet

marcidee

Board Regular
Joined
May 23, 2016
Messages
184
Office Version
  1. 2019
Please can someone help with a formula or VBA script.


I have one workbook (payslip sort) that contains several sheets (one sheet per person that contains a breakdown of their pay) - I have another workbook (payslip macro) that contains a list of names in column A and next to their names in Column B their email address.


Is it possible to have a code that looks up the name on each sheet in (payslip sort) which can be find in A2 (see below example) - and search for that name in the other worksheet (payslip macro) (the list at present located in sheet2 - however this can be moved if that is a problem or even added to the main worksheet) - and copy the email address to i1 in payslip sort.

Payslip sort
NameP/E DateShiftCompanyLocationUnitsPay RateTotal Payzak@bbc.com
Zak Mon 29 Jul 2019NA - DayConstance xxxxxxxxxxxxxxxxxxxxxxxxxx.509.004.50
Zak Mon 29 Jul 2019NA - DayDermott xxxxxxxxxxxxxxxxxxxxxxxxxx45.009.00405.00
Zak Mon 29 Jul 2019NA - DayKelly xxxxxxxxxxxxxxxxxxxxxxxxxx1.009.009.00

<colgroup><col><col><col><col><col><col span="6"></colgroup><tbody>
</tbody>


Payslip macro (sheet2)
Zakzak@bbc.com
nigelnigel@itv.com
barrybarry@sky.com

<colgroup><col span="3"></colgroup><tbody>
</tbody>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hello,

Isn't it just a case of having a VLOOKUP?

i.e. = VLOOKUP(A2,(payslip macro, sheet 2 cols A & B),2,0)

you will need to change (payslip macro, sheet 2 cols A & B) to the actual workbook range.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,915
Members
448,532
Latest member
9Kimo3

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