populate balance for the last row based on sheet name from file to another

Alaa mg

Active Member
Joined
May 29, 2021
Messages
343
Office Version
  1. 2019
Hi guys
I need macro import balance from closed file to open file based on match sheet name for the closed file with cell B2 for open file
then should populate amount from column F in last row to D2 for open file.
both files are existed in the same folder "C:\Users\RAMDANI\Desktop\BALANCES"

closed file
as
CDEF
1DESCRIBEDEBITCREDITBALANCE
2INVO-0012,000.0002,000.000
3PAID1,000.0001,000.000
ALI




open file
qw
ABCD
1CLIENTBALANCE
2ALI
3
4
5
6
7
8
9
10
SS


result
qw
BCD
1CLIENTBALANCE
2ALI1000
SS


another case


as
CDEF
1DESCRIBEDEBITCREDITBALANCE
2INVO-0022,000.0001,000.0001,000.000
3PAID500.0001,000.000500.000
4INVO-0032,000.0002,500.000
5INVO-0041,500.0004,000.000
6INVO-0052,000.0006,000.000
7PAID1,200.0004,800.000
OMAR


qw
BCD
1CLIENTBALANCE
2OMAR
SS


result
qw
BCD
1CLIENTBALANCE
2OMAR4800
SS

and should replace value every time run the macro .
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,215,102
Messages
6,123,097
Members
449,096
Latest member
provoking

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