Solved

Copy Sheet to another sheet not working

Posted on 2013-06-20
2
252 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 80

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 80

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
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.

747 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

12 Experts available now in Live!

Get 1:1 Help Now