Copy and paste macro

jethro11

New Member
Joined
Aug 27, 2002
Messages
14
Hi,
Every week I copy and paste data from a flat file and append it to an excel spreadsheet with several worksheets. The flat file is a monthly file while the excel spreadsheet contains data for the whole year (each week the updated data from the flat file is appended to the worksheets in the spreadsheet).
The flat file contains natural gas consumption data for furnaces e.g. furnace 1, furnace 2, furnace 3, furnace 4, furnace 5, furnace 6...... The excel spreadsheet has separate worksheets for groups of furnaces e.g. furnace 1, furnace 2 , furnace 3 in worksheet 1; furnace 4, furnace 5, furnace 6 in worksheet 2 etc.
Is there a macro which can automate this task? I would greatly appreciate some help with this! Thanks!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
"is there a macro"... well no, but you can write one.

You will probably need to format the data on one worksheet and then copy it to the yearly.

The first thing is to automate the copy/paste you are doing.... have you tried importing from text file directly into excel?
 
Upvote 0
Yes, as a matter of fact I do convert the flat file into an excel spreadsheet and then copy and paste columns from that spreadsheet to the yearly spreadsheet. However the process of selecting a bunch of cells from one spreadsheet to a worksheet in another spreadsheet is very cumbersome.
The complicated part I can't figure out is this:
In the beginning of September '02 the flat file would have data for the first week which is copied and appended to the yearly spreadsheet. Next week we now have data for the first 2 weeks, but I would only copy data for the 2nd week and append it to the yearly spreadsheet. How do I prevent data being overwritten?? Thanks!
 
Upvote 0

Forum statistics

Threads
1,222,014
Messages
6,163,392
Members
451,834
Latest member
tomtownson

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