Solved

Combining process to copy cells

Posted on 2013-06-20
2
193 Views
Last Modified: 2013-06-20
Is there a better way to combine the below code to copy cells from one sheet to another?


Sheets("Compare").Select
    Range("C3:C5000").Select
    Selection.Copy
    Sheets("Prices").Select
    Range("A4").Select
    ActiveSheet.Paste
   
    Sheets("Compare").Select
    Range("AJ3:AJ5000").Select
    Selection.Copy
    Sheets("Prices").Select
    Range("B4").Select
    ActiveSheet.Paste

Sheets("Compare").Select
    Range("AP3:AP5000").Select
        Selection.Copy
    Sheets("Prices").Select
    Range("C4").Select
    ActiveSheet.Paste

Sheets("Compare").Select
    Range("AQ3:AQ5000").Select
     Selection.Copy
    Sheets("Prices").Select
    Range("D4").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 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 315 total points
ID: 39263363
Something like this?

Dim shtCompare As Worksheet, shtPrices As Worksheet

Set shtCompare = Sheets("Compare")
Set shtprice = Sheets("Prices")
    
shtCompare.Range("C3:C5000").Copy Sheets("Prices").Range("A4")
shtCompare.Range("AJ3:AJ5000").Copy Sheets("Prices").Range("B4")
shtCompare.Range("AP3:AP5000").Copy Sheets("Prices").Range("C4")
shtCompare.Range("AQ3:AQ5000").Copy Sheets("Prices").Range("D4")

Open in new window

0
 

Author Comment

by:leezac
ID: 39263588
Yes  - thank you
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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 …
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

756 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