Copy to next blank row in another workbook macro

maratonomak

New Member
Joined
May 26, 2015
Messages
14
Hi,

Is there any way to export tables from a workbook to another using a macro?
Here's what I have. Workbook1 has tables exported from access queries. Tables are exported into sheets (F01,F02,F03......F10).
This tables needs to be exported to another workbook (Workbook2) to next blank row. So, table from Workbook1/Sheet F01 to be exported to next blank row, Workbook2/Sheet F02.
And repeat the process for sheet F02, F03 to F10. Some of the tables may be empty sometimes. Is there any way to use N/A in that case?

Any help would be greatly appreciated !
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I'm trying the code below"

Public Sub copy_wb()

Dim copy_from As Range
Dim copy_to As Range

Set copy_from = Workbooks("Validation").Worksheets("F01").UsedRange
Set copy_to = Workbooks("Validation Update").Worksheets("F01").Range("C" & Rows.Count).End(xlUp).Offset(5, 0)

copy_from.Copy Destination:=copy_to
Application.CutCopyMode = False

End Sub

But I'm getting the following error: Subscript out of range.
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,186
Members
449,071
Latest member
cdnMech

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