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: 9
Default Copy and pasting ranges

I am new to programming in Excel, so forgive me if there is an obvious answer
to this question.

I have created a button that will copy 2 ranges from 2 different
spreadsheets and paste them onto a 3rd spreadsheet. The button is located on
the 3rd spreadsheet. The code copies and pastes the 1st range, then moves
the curser to a new line, then copies and pastes the 2nd range.

The code works fine for the 1st range and repositioning the curser, but when
it gets to the 2nd range, it give me an error.
"Run-time error €˜1004:
The information cannot be pasted because the Copy area and the paste area
are not the same size and shape."

Then it brings me to the ActiveSheet.Paste line in the 2nd Paste code. (See
full code below.)

Worksheets("Danka").Range("DANKA").Copy
†’†’ ActiveSheet.Paste

If I take out the code for the 2nd range the code works fine with no errors
and the curser is left on a new line.

Here's the code I'm using:

Private Sub Ranges_Click()

Worksheets("Charrette").Range("CHARRETTE").Copy
ActiveSheet.Paste

Application.SendKeys ("{ESCAPE}")
Application.SendKeys ("{DOWN}")
Application.SendKeys ("{END}")
Application.SendKeys ("{DOWN}")
Application.SendKeys ("{DOWN}")

Worksheets("Danka").Range("DANKA").Copy
ActiveSheet.Paste

End Sub

Can someone please help me?

Thank you,

Rachel

 
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
Pasting Large Ranges into a List Jamesh5q6 Excel Worksheet Functions 2 August 13th 07 01:28 PM
Copy data in named ranges to a newer version of the same template to identical ranges handstand Excel Programming 0 August 21st 06 03:51 PM
cutting and pasting ranges using offsets timmulla Excel Programming 2 July 14th 05 06:28 PM
how to avoid merging when pasting multiple ranges Stian Excel Programming 6 May 20th 05 03:29 PM
Selecting & Pasting Dynamic Ranges GerryM[_2_] Excel Programming 4 November 17th 04 09:12 AM


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