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: 117
Default Copying Book1 to Book2 without selecting

Hi everyone

I require help to copy 21 rows of data (Value and Number Format only) from
Book1 Sheet1 to Book2 which contains 21 sheets.
What Im trying to achieve is copy row2 in Book1 Sheet1 to the row2 in Book2
Sheet1.
Then copy row3 Book1 Sheet1 to row2 of Book2 Sheet2, continuing until all 21
rows are copied across.

Question 1. Can the above copying be achieved without actually selecting
Book2.?

The data is then changed in Book1 and the copying across process is repeated
again, placing the data on row2 of Book2. The data change and copying across
could happen 60 or more times.

The code Im using at the moment is taking 8 or 9 minutes to run.
If involves coping all 21 rows across to sheet1 then Offsetting down 1 row
cutting and copying to next sheet. selecting Book 1 to change data and start
copy again.

Part of present code.

Dim wbk As Workbook
Set wbk = Workbooks("Book2.xls")
------
wbk.Activate
Sheets("Sheet1").Select
Cells(Rows.Count, "B").End(xlUp).Offset(1, 0).PasteSpecial Paste:= _
xlPasteValuesAndNumberFormats
€˜
Application.CutCopyMode = False
€˜
ActiveCell.Offset(1, 0).Range("A1:C20").Cut
'
Sheets("Sheet2").Select
Etc. etc. for 60 or more times.

Question 2. If copying without selecting Book 2 is possible would nested For
Next Statements outer one for data change, inner one for copying and pasting
be the way to achieve required outcomes?

Any help greatly appreciated

--
Thank you

Regards

Bob C
Using Windows XP Home + Office 2003 Pro
 
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
VBA - Testing for Book1, Book2 etc. dhstein Excel Discussion (Misc queries) 1 May 22nd 09 10:12 AM
Book1 and Book2 JohnR Excel Discussion (Misc queries) 2 July 6th 07 02:10 AM
=SUMIF(book2!L3:AF3, "=book1!O30", book2!L20:AF20) dond Excel Discussion (Misc queries) 1 November 8th 05 12:33 PM
run macro in book1 from book2 - how? billy Excel Programming 1 December 18th 03 05:59 PM
IE to Book1, to book2, then close Book1.xls GotDebt Excel Programming 3 December 5th 03 08:31 PM


All times are GMT +1. The time now is 10:05 AM.

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"