LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Copy/paste macro blocking

Dear All,

I prepared a code that should:
- copy last used line from currently used workbook
- paste it to the first free line on all other opened workbooks

For some reason, the code blocks on the line:
FirstFreeRow = Range("B7").End(xlDown + 1).Row


Can you tell me what should I modify?
Thanks a lot,
Mark
-----------------
Here's the code:

Sub Macro7()

Dim wbk As Workbook

lastDataRow = Range("B7").End(xlDown).Row
Range("B" & lastDataRow).Select
Range(ActiveCell, ActiveCell.Offset(0, 9)).Select
Selection.Copy

'it would be also useful to exclude the file we just used, but at the end I
can also live without it (=delete the double row manually after the macro is
executed)
For Each wbk In Application.Workbooks
wbk.Activate
Worksheets("Sheet1").Activate
FirstFreeRow = Range("B7").End(xlDown + 1).Row
Range("B" & FirstFreeRow).Select
Selection.Paste
Next wbk

End Sub


 
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
Non-blocking calls to Excel Macro using OLE Automation BW Excel Programming 5 August 3rd 05 09:13 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM
Macro to Copy/Paste then Paste to Next Line tomkarakowski Excel Programming 1 May 28th 04 01:19 AM


All times are GMT +1. The time now is 11:07 PM.

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

About Us

"It's about Microsoft Excel"