Copy Contents from one worksheet to another

Kizinti

New Member
Joined
Nov 30, 2005
Messages
43
Greetings, first timer so be gentle,
I have a spread sheet that uses a worksheet_change macro. I would like to either create a second macro, or in the same macro when the changes are implimented, copy the contents on the row that was changed (A-J) onto the last available line of an "ARCHIVE" page (i.e. a change tracker page).

The attempts I have tried so far capies the contents 607 times??? What am I doing wrong? Any suggestions.

Thanks,
Kizinti
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
To all,
I figured out the problem. In the Worksheet_Change Macro, I make changes to target cells. What I did not realise that whenever a change was made in the target range specified, the macro is called. Thus I was making chages, the macro was making changes, that called itself, etc, etc, etc.

A simple boolean flag that said, "if blnflag = True Then Exit Sub" fixed it. In the Macro, blnFlag was set to True while it was running, until the end where it was set back to False.

All I can say is "DOH!" <SMACK>
 
Upvote 0
If that's the case, all you need to use is Application.EnableEvents=False at the beginning of the code and then set it to True at the end :)
 
Upvote 0
I did try that, but for some reeason my chages where not being done. When I put in the boolean flag, The changes were made, but the copy was done only once. Thanks though
 
Upvote 0

Forum statistics

Threads
1,223,306
Messages
6,171,324
Members
452,396
Latest member
ajl_ahmed

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