VBA macro to copy rows based on criteria then insert rows on another sheet and paste

sfric

New Member
Joined
Apr 18, 2013
Messages
2
Hello all,

I've searched this forum and can't find a solution for a problem like I have:

In the "Main" sheet I have the following:

Area
JanFebMar
Section110075125
Section2505075
Section3252875
Section41010050

<colgroup><col style="width:48pt" span="4" width="64"> </colgroup><tbody>
</tbody>

The "Input" sheet contains the following:

Category
AreaJanFebMar
RevenueSection350
ExpenseSection120
ExpenseSection220
RevenueSection120
TaxSection410
TaxSection315
RevenueSection225

<colgroup><col style="width:48pt" span="5" width="64"> </colgroup><tbody>
</tbody>

After the macro is run I would like the "Main" sheet to look as follows:

Area
JanFebMar
Section110075125
Expense200
Revenue
020
Section1 Total12095125
Section2505075
Expense20
Revenue25
Section2 Total5070100
Section3252875
Tax15
Section3 Total254375
Section41010050
Tax10
Section4 Total1011050

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

Keep in mind that rows will be added to the input tabs each month and therefore require rows to be appended under each "Section".

Any help would be greatly appreciated.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
can you upload your data file how it looks i have the solution but need to see your data how looks ?
 
Upvote 0
kevatarvind, thanks for your reply, however, my posting permissions do not allow me to post attachments. You can copy and paste the first two tables i provided into different sheets to replicate what i'm trying to do. The third sheet is what the result should look like. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,203,524
Messages
6,055,906
Members
444,832
Latest member
bgunnett8

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