Excel VBA MACRO - Transfer the data from one sheet to another sheet

fahadalambd

New Member
Joined
Sep 16, 2022
Messages
31
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone,

As you can see in the attached screenshots - I have two sheets ("Sheet1" & "Sheet2") in same excel file.

Some items are common in both "Sheet1" and "Sheet2". For example - Pen Paper, Mango, Book & Suger.

Now I need a VBA script which will automatic transfer the "Price of the common items (Pen Paper, Mango, Book & Suger)" from Sheet1 to Sheet2 and vice-versa.

Please help me regarding this. Thanks in advance
 

Attachments

  • Sheet1.PNG
    Sheet1.PNG
    12.2 KB · Views: 21
  • Sheet2.PNG
    Sheet2.PNG
    19.5 KB · Views: 20

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Why do you need VBA when a simple formula will do?
 
Upvote 0
Book1
AB
1ItemPrice
2Paper10
3Pen15
4Tulip 
5Apple5
6Pear12
7Pasta 
8Salt42
9Rice23
Sheet2
Cell Formulas
RangeFormula
B2:B9B2=XLOOKUP(A2,Sheet1!A2:A9,Sheet1!B2:B9,"")
 
Upvote 0
Solution
Sorry for the late reply and many thanks for the answer. It is working now . Huge thanks again :D
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,174
Members
452,615
Latest member
bogeys2birdies

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