Macro - Export data to an already existing file

lrmedina89

New Member
Joined
Feb 9, 2015
Messages
12
Hi all,

I am having some troubles when it comes to create a macro to export data to an already existing file.

I have a file which will be changed every day (soruce file) and another one which I want to use as an archive (final destination file).

Can any of you give me soem hints? I am creating my own code but it doesn't do what I want and also modifiying some other codes that I found on the internet.

Thanks!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
This is the code that I am using
I would also like the macro to stop if there is a blank cell.

Sub Exportdata()


Application.ScreenUpdating = False
Range("B7:J27").Select
Selection.Copy

Workbooks.Open filename:="C:\Archive - orders.xlsm"
Range("B" & Rows.Count).End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste Link:=True
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWindow.Close
Range("B7").Select
Application.ScreenUpdating = True



End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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