Solved

Copy Sheet to another sheet not working

Posted on 2013-06-20
2
260 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
  • 2
2 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

912 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now