Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Copy paste an named range with VBA in Excel

Posted on 2011-03-23
3
Medium Priority
?
666 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
[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
3 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 2000 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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