Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Select Variable Range paste last row + 1

Hello,

Looking for macro solution to perform following

1) Copy Variable Range (A2:C?) from source.xls
2) Paste Range to last row + 1 destination.xls

There are many posts concerning but none are performing task needed.
Ron de Bruin's solution in posting "copy & paste macro" has come closest but
I continually get compile error.

Thanks in advance for any assistance.

BR,

Steven



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Select Variable Range paste last row + 1

Dim RngToCopy as range
dim DestCell as range

with workbooks("source.xls").worksheets("somesheetnameh ere")
set rngtocopy = .range("A2:C" & .cells(.rows.count,"A").end(xlup).row)
end with

with workbooks("Destination.xls").worksheets("someother sheetnamehere")
set destcell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with

rngtocopy.copy _
destination:=destcell



The code depends on the last used cell in column A for both ranges.

SteveT wrote:

Hello,

Looking for macro solution to perform following

1) Copy Variable Range (A2:C?) from source.xls
2) Paste Range to last row + 1 destination.xls

There are many posts concerning but none are performing task needed.
Ron de Bruin's solution in posting "copy & paste macro" has come closest but
I continually get compile error.

Thanks in advance for any assistance.

BR,

Steven


--

Dave Peterson
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
Select a variable range Bluecat Excel Worksheet Functions 7 January 13th 09 01:24 AM
Select variable range ewan7279 Excel Programming 1 September 5th 07 09:46 AM
Select a variable range Eduardo Excel Programming 7 August 8th 07 01:46 PM
Use a Variable to select a range Connie Excel Discussion (Misc queries) 3 October 19th 06 05:48 PM
Select a Range Through a Variable GoFigure[_9_] Excel Programming 3 December 6th 05 01:02 PM


All times are GMT +1. The time now is 07:55 AM.

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"