?
Solved

Copy Sheet to another sheet not working

Posted on 2013-06-20
2
Medium Priority
?
297 Views
Last Modified: 2013-06-20
I recorded a macro below but it does not work.  I get a run-time error 1004.  It is a simple copy one sheet to another.  I just can't figure out.

  Sheets("Prices").Select
   
Rows("3:1853").Select
    Selection.Copy
    Sheets("Compare").Select
   
    Range("A3").Select
    ActiveSheet.Paste
0
Comment
Question by:leezac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 2000 total points
ID: 39263846
Are the worksheets really named Prices and Compare? That's a common cause of run-time error 1004.

You could also try this one-liner:
Sub Copytron()
Sheets("Prices").Rows("3:1853").Copy Sheets("Compare").Range("A3")
End Sub

Open in new window

0
 
LVL 81

Expert Comment

by:byundt
ID: 39263867
Another possible cause is if worksheet Compare is protected. If so, the run-time error 1004 should say something about protected cells.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question