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: 333
Default Chk sheet exits, copy all to another book.

Hi,

I am trying to copy everything on these three pages on to another sheet in
another workbook. I'm having trouble getting this to work. Can I do it this
way?

ictr = 0

For ictr = 1 To 3
Debug.Print ictr

On Error Resume Next
Select Case ictr
Case 1
Set rngCopyFrom = wbkCopyFrom.Notespg.Cells
Set rngCopyTo = wbkCopyTo.Notespg
Case 2
Set rngCopyFrom = wbkCopyFrom.Firstpg.Cells
Set rngCopyTo = wbkCopyTo.Firstpg
Case 3
Set rngCopyFrom = wbkCopyFrom.Lastpg.Cells
Set rngCopyTo = wbkCopyTo.Lastpg
End Select

On Error GoTo 0
If rngCopyFrom Is Nothing Then
'do nothing
Else
rngCopyTo.Value = rngCopyFrom.Value
End If

Next


--
Thanks for your help.
Karen53
 
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
Can not copy a sheet to another book dveer Excel Worksheet Functions 7 April 28th 10 03:47 PM
Too Few Rows to copy sheet to another book snowboardbaltimore Excel Worksheet Functions 2 April 19th 10 05:36 PM
Copy a sheet to a new book unsuccessful sunan Excel Discussion (Misc queries) 3 June 23rd 08 12:52 PM
create new book and copy sheet into.. Kstalker[_10_] Excel Programming 5 July 3rd 05 11:14 PM
copy printarea from more than 3 sheet & save in new book. Shital Excel Programming 1 October 4th 03 10:47 AM


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