Solved

Copy paste an named range with VBA in Excel

Posted on 2011-03-23
3
618 Views
Last Modified: 2012-05-11
I have a worksheet with one worksheet per client.  However, I need to copy the client named rnages of data into one worksheet called DataSource.  That is, ranges CLIENTONE, CLIENT TWO, CLIENTTHREE, etc. named ranges copied to the DataSource worksheet.  Of course, the code would find the last blank row and copy the next range there, but how to I tell it to simply copy the entire range, not just the range name?
0
Comment
Question by:ssmith94015
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 35200545
use something like:

range("CLIENTONE").copy sheets("Destination").cells(rows.count,1).end(xlup).offset(1)

Open in new window


Thomas
0
 

Author Closing Comment

by:ssmith94015
ID: 35200760
Thank you - it was so simple
0
 
LVL 39

Expert Comment

by:nutsch
ID: 35200794
Glad to help.

Thomas
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

758 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

14 Experts available now in Live!

Get 1:1 Help Now