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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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