Copy and pste value

sujittalukde

Well-known Member
Joined
Jun 2, 2007
Messages
520
I need a macro which will copy the row containg the word "Carried over" and paste it to next row as "Brought Forward" However if below the Carried over, the word "Grand Total" exist, then no such copy paste is required.
A sample shot is given below for better understanding.

In case some more clarification required, do let me know.
CarriedOverBroughtFwd.xls
ABCD
1NamesAmount
2a3
3b4
4c5
5Carried over12This is the page sub total
6Brought Forward12This is the copy of above row containing "carried over"
7e9
8f8
9g7
10Carried over24This is the page sub total
11Brought Forward24This is the copy of above row containing "carried over"
12h7
13i4
14j3
15Carried over14This is the page sub total
16Grand Total50Since below the Carried over, grand total so no
17paste value is required from above row
Sheet1
 
Dear DP, swaped the line and running correctly.

Dear sosasola, your code is not giving the desired result.Anyway thanks for the effort.

One more thing:

Can this be modified in such a manner that:

The code will insert page break above the "Brought Forward " so that "brought Forward" will appear at the top of each page..

If this can be provided, it will be great help to me.
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,216,071
Messages
6,128,626
Members
449,460
Latest member
jgharbawi

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