Solved

Selecting a range, defining it to use later in a procedure.

Posted on 2014-10-29
3
59 Views
Last Modified: 2014-10-29
I am copying 500 rows of data.  How would I recall these to use later in a procedure?
Could I use: RangeToUseLater = ??

Range(ActiveCell, ActiveCell.Offset(499, 0)).Copy

I need to run a few other thing before I get the range.  Or do I need to re-org the sequence so I get it when I need it?
0
Comment
Question by:RWayneH
[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
3 Comments
 
LVL 19

Expert Comment

by:Montoya
ID: 40410983
you can simply name the range, and use it later in a formula, etc...
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40411119
Dimension a range variable then assign this range to it like so:
Option Explicit
Dim rng as Range

Sub MyProcedure()
.
.
.
Set rng = Range(ActiveCell, ActiveCell.Offset(499, 0))
.
'do other stuff
.
.
rng.Copy
.
'
.
End Sub

Open in new window


If you're range is on a different sheet than the destination, you'll want to define the range as part of that specific worksheet.

Regards,
-Glenn
0
 

Author Closing Comment

by:RWayneH
ID: 40412375
Thanks for the help
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

623 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