Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default Copy and Paste Problems

I want to copy and paste the following cells:

Copy cells A1:x5 from the Work Schedule tab and paste to cells A1:X5 on the
Overtime tab

Copy cells D6:D35 from the Work Schedule tab and paste to the cells D15:X44
on the Overtime tab

I created a button with the following code but get a run-time error 438

Sheets("Work Schedule").Range("A1:X5").COPY
Sheets("Overtime").Range("a1:X5").Paste
Sheets("Work Schedule").Range("D6:X35").COPY
Sheets("Overtime").Range("D15:x44").Paste
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Copy and Paste Problems

Anna,

Try passing the destination to the call to Copy. For example:

With Sheets("Work Schedule")
.Range("A1:X5").Copy Sheets("Overtime").Range("a1:X5")
.Range("D6:X35").Copy Sheets("Overtime").Range("D15:x44")
End With


--
Hope that helps.

Vergel Adriano


"Anna" wrote:

I want to copy and paste the following cells:

Copy cells A1:x5 from the Work Schedule tab and paste to cells A1:X5 on the
Overtime tab

Copy cells D6:D35 from the Work Schedule tab and paste to the cells D15:X44
on the Overtime tab

I created a button with the following code but get a run-time error 438

Sheets("Work Schedule").Range("A1:X5").COPY
Sheets("Overtime").Range("a1:X5").Paste
Sheets("Work Schedule").Range("D6:X35").COPY
Sheets("Overtime").Range("D15:x44").Paste

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Copy and Paste Problems

It don't like the Paste. Try this and watch the word wrap on the newsreader.
There should be only two lines.

Sheets("Work Schedule").Range("A1:X5").COPY Sheets("Overtime").Range("A1:X5")
Sheets("Work Schedule").Range("D6:X35").COPY
Sheets("Overtime").Range("D15:X44")

"Anna" wrote:

I want to copy and paste the following cells:

Copy cells A1:x5 from the Work Schedule tab and paste to cells A1:X5 on the
Overtime tab

Copy cells D6:D35 from the Work Schedule tab and paste to the cells D15:X44
on the Overtime tab

I created a button with the following code but get a run-time error 438

Sheets("Work Schedule").Range("A1:X5").COPY
Sheets("Overtime").Range("a1:X5").Paste
Sheets("Work Schedule").Range("D6:X35").COPY
Sheets("Overtime").Range("D15:x44").Paste

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default Copy and Paste Problems

Thank you both very much.

"Vergel Adriano" wrote:

Anna,

Try passing the destination to the call to Copy. For example:

With Sheets("Work Schedule")
.Range("A1:X5").Copy Sheets("Overtime").Range("a1:X5")
.Range("D6:X35").Copy Sheets("Overtime").Range("D15:x44")
End With


--
Hope that helps.

Vergel Adriano


"Anna" wrote:

I want to copy and paste the following cells:

Copy cells A1:x5 from the Work Schedule tab and paste to cells A1:X5 on the
Overtime tab

Copy cells D6:D35 from the Work Schedule tab and paste to the cells D15:X44
on the Overtime tab

I created a button with the following code but get a run-time error 438

Sheets("Work Schedule").Range("A1:X5").COPY
Sheets("Overtime").Range("a1:X5").Paste
Sheets("Work Schedule").Range("D6:X35").COPY
Sheets("Overtime").Range("D15:x44").Paste

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
Two Problems Re Copy & Paste Robert11 New Users to Excel 1 February 13th 08 02:15 PM
copy and paste between xls file syntax problems dr chuck Excel Programming 1 July 26th 06 05:55 AM
Problems with Copy and Paste in Excel signal2noise Excel Worksheet Functions 1 August 19th 05 12:27 PM
Copy - Paste problems Guillermo Excel Discussion (Misc queries) 0 April 9th 05 04:27 AM
Format Problems using Copy/Paste with QueryTable Hudel Excel Programming 0 November 17th 03 06:36 PM


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