Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy And Paste Query

Status
Not open for further replies.

robcarr

Programmer
May 15, 2002
633
GB
Dear All,

When runnning my report using VBA, I have to do a lot of copying and pasting of data from one book to another, on occassion the coding drops out as the data it is copying is blank(no data for that day),

Error Message

The message that appears is Run time error 1004,
The information can not be pasted because the copy are and the paste area are not the same size and shape.

How can I get my coding to either do 1 of the following

1) check to see if there is coding before copying the data
2) Always paste the data regardless of what has been copied.

Any help will be greatly appreciated.
 
Rob,

Not sure what you mean be 1) but try the following:

After the statement to Copy have your code select a single cell as the Paste destination. You can also add some error trapping so the code doesn't bomb out if the Paste operation cannot be completed.


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top