View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default 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?