Put two ranges into one range from two sheets

Mussa

Active Member
Joined
Jul 12, 2021
Messages
262
Office Version
  1. 2019
  2. 2010
Hello,
I want macro to combine data for two sheets into one sheet by collection ranges.
MUSA.xlsm
ABCDE
1ITEMNAMEDEBITCREDITBALANCE
21AMUSSAN4,000.004,000.00
32ASSUMAN5,000.003,000.002,000.00
43MUSSA2,000.001,000.001,000.00
54MUSSAN3,000.003,000.00
65MUSSI1,300.00300.001,000.00
76OSMAAN1,100.001,000.00100.00
8TOTAL16,400.005,300.0011,100.00
RECEIVABLE
Cell Formulas
RangeFormula
E2:E7E2=C2-D2
C8:E8C8=SUM(C2:C7)



MUSA.xlsm
ABCDE
1ITEMNAMEDEBITCREDITBALANCE
21AMEER3,000.00-3,000.00
32AMIR300.00-300.00
43ASIIF5,000.00-5,000.00
54AZIZ12,000.00-12,000.00
65SAMMER1,100.007,000.00-5,900.00
76SANDI3,200.006,000.00-2,800.00
87SANI5,000.006,000.00-1,000.00
9TOTAL9,300.0039,300.00-21,700.00
PAYABLE
Cell Formulas
RangeFormula
E2:E8E2=C2-D2
C9:D9C9=SUM(C2:C8)
E9E9=SUM(E5:E8)


result

MUSA.xlsm
ABCDE
1ITEMNAMEDEBITCREDITBALANCE
21AMUSSAN4,000.004,000.00
33ASSUMAN5,000.003,000.002,000.00
44MUSSA2,000.001,000.001,000.00
55MUSSAN3,000.003,000.00
66MUSSI1,300.00300.001,000.00
77OSMAAN1,100.001,000.00100.00
88AMEER3,000.00-3,000.00
99AMIR300.00-300.00
1010ASIIF5,000.00-5,000.00
1111AZIZ12,000.00-12,000.00
1212SAMMER1,100.007,000.00-5,900.00
1313SANDI3,200.006,000.00-2,800.00
1414SANI5,000.006,000.00-1,000.00
15TOTAL25,700.0044,600.00-18,900.00
REPORT

thanks
 
Hi peter
I'm not sure why problem shows in formatting despite of this line is existed
VBA Code:
  Sheets("REPORT").UsedRange.EntireRow.Delete
this is what I got.
fr.JPG

I look forward as in result in OP !
I hope to hear from you soon.
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I look forward as in result in OP !
I hope to hear from you soon.
Your reply in post 9 and marking post 8 as the solution implies that the code worked for you back then. It still does for me using the post 1 sample data.
What has changed since then? (Look carefully in 'PAYABLE' in the row below the TOTAL row. Could there be something somewhere in that row?)

If your raw data has changed, please post 'RECEIVABLE' and 'PAYABLE' again with XL2BB
If you have changed the post 8 code in any way then please post the current code that you are using.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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