Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Paste row to new workbook

Hi,

I have been fiddling with this for ever!! Below is the code i am using to
select the last record of 'Site Reading Log' to a new sheet in the same
workbook called 'Destination'

Question:
How can i copy the last row in 'Site Reading Log' and paste it to a new
workbook, called 'Site Reading Export'.xls, rather to a sheet within the
exiting workbook.

All your help is really appreciated!

Sub Button2_Click()

With Sheets("Site Reading Log") 'source
.Rows(.Cells(Rows.Count, "A").End(xlUp).Row).Copy
Sheets("Destination").Rows(1) 'destination
End With

End Sub

--
Carlee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Paste row to new workbook

My apologies Carlee,

I did not properly read your question the first time. I tested what you want
to do and I have not been able to paste into another workbook without
selecting the destination. This really surprises me but perhaps there is a
way of doing it and I just do not know how. However, the following appears to
work but perhaps not the way you would prefer for your code:-

With Workbooks("Copy From.xls").Sheets("Site Reading Log")
.Rows(.Cells(Rows.Count, "A").End(xlUp).Row).Copy
End With

Workbooks("Site Reading Export.xls"). _
Sheets("Destination").Rows(1).Select

ActiveSheet.Paste

Regards,

OssieMac

"Carlee" wrote:

Hi,

I have been fiddling with this for ever!! Below is the code i am using to
select the last record of 'Site Reading Log' to a new sheet in the same
workbook called 'Destination'

Question:
How can i copy the last row in 'Site Reading Log' and paste it to a new
workbook, called 'Site Reading Export'.xls, rather to a sheet within the
exiting workbook.

All your help is really appreciated!

Sub Button2_Click()

With Sheets("Site Reading Log") 'source
.Rows(.Cells(Rows.Count, "A").End(xlUp).Row).Copy
Sheets("Destination").Rows(1) 'destination
End With

End Sub

--
Carlee

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Paste row to new workbook

Try this Carlee:-

With Sheets("Site Reading Log") 'source
.Rows(.Cells(Rows.Count, "A").End(xlUp).Row).Copy _
Destination:=Sheets("Destination").Rows(1) 'destination
End With

Regards,

OssieMac

"Carlee" wrote:

Hi,

I have been fiddling with this for ever!! Below is the code i am using to
select the last record of 'Site Reading Log' to a new sheet in the same
workbook called 'Destination'

Question:
How can i copy the last row in 'Site Reading Log' and paste it to a new
workbook, called 'Site Reading Export'.xls, rather to a sheet within the
exiting workbook.

All your help is really appreciated!

Sub Button2_Click()

With Sheets("Site Reading Log") 'source
.Rows(.Cells(Rows.Count, "A").End(xlUp).Row).Copy
Sheets("Destination").Rows(1) 'destination
End With

End Sub

--
Carlee

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
copy multiple worksheets of a workbook, and paste onto a Word document ( either create new doc file or paste onto an existing file.) I need this done by VBA, Excel Macro Steven Excel Programming 1 October 17th 05 08:56 AM
Selecting data from 1 workbook to copy and paste to a 2nd workbook JackSpam Excel Programming 2 July 20th 05 02:33 AM
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM
Need a macro to copy a range in one workbook and paste into another workbook Paul Excel Programming 8 July 1st 04 07:42 AM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM


All times are GMT +1. The time now is 04:20 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"