Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofill formulas when inserting rows in excel tables FredZack Excel Discussion (Misc queries) 0 April 28th 10 02:04 PM
Inserting/Deleting Columns in Tables KimPotter Excel Discussion (Misc queries) 3 October 15th 08 12:22 AM
Inserting lines into tables AussieDave[_2_] Excel Programming 4 April 3rd 06 09:38 PM
Inserting commands in Macros Norton704 Excel Worksheet Functions 1 July 28th 05 06:32 PM
Pivot tables - inserting columns Scott Excel Worksheet Functions 1 March 19th 05 01:07 AM


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"