Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting tables with macros
Im trying to use a macro to get a table from one spreadsheet and place it in
another, then directly underneath this I need to insert another table. I have this macro in place but the tables will have a different amount of rowes each time I need to perform the macro. What macro would I use to enable me to insert the second table one line under where the first table finishes, regardless of how long the table is? Any ideas? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting tables with macros
hi
Sub Macro1() Workbooks.Open Filename:="K:\Excel\XCEL\History.xls" Range("A1", Range("A1").End(xlDown).Offset(0, 10)).Copy 'the last line select 10 rows right. change if needed. Windows("Book1").Activate Range("A1").Select Range("A1").End(xlDown).Offset(1, 0).Select ' the last row select 1 row down ActiveCell.PasteSpecial xlPasteAll Windows("History.xls").Activate ActiveWorkbook.Close End Sub change to suit your data. regards FSt1 "jamesea" wrote: Im trying to use a macro to get a table from one spreadsheet and place it in another, then directly underneath this I need to insert another table. I have this macro in place but the tables will have a different amount of rowes each time I need to perform the macro. What macro would I use to enable me to insert the second table one line under where the first table finishes, regardless of how long the table is? Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofill formulas when inserting rows in excel tables | Excel Discussion (Misc queries) | |||
Inserting/Deleting Columns in Tables | Excel Discussion (Misc queries) | |||
Inserting lines into tables | Excel Programming | |||
Inserting commands in Macros | Excel Worksheet Functions | |||
Pivot tables - inserting columns | Excel Worksheet Functions |