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

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?
Who is Participating?
Glenn RayConnect With a Mentor Excel VBA DeveloperCommented:
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
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.

MontoyaProcess Improvement MgrCommented:
you can simply name the range, and use it later in a formula, etc...
RWayneHAuthor Commented:
Thanks for the help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.