Can you dimension Range more than 1 way

P

Patrick C. Simonds

In my routine I have the following Dim statement:

Dim mg As Range
Set mg = Range("Employees")

but I need to add the following in the same routine::

Dim rng
Set rng = Cells(ActiveCell.Row, 1)
 
A

Alan

In my routine I have the following Dim statement:

Dim mg As Range
Set mg = Range("Employees")

but I need to add  the following in the same routine::

Dim rng
Set rng = Cells(ActiveCell.Row, 1)

Just leave out the 2nd Dim statement
 
R

royUK

Patrick said:
In my routine I have the following Dim statement:
Code
-------------------
Set mg = Range("Employees")

but I need to add the following in the same routine::

Dim rng
Set rng = Cells(ActiveCell.Row, 1 -------------------

Unless it's a typo you are using two range variables.

To use one variable

Code
-------------------

Dim rng As Range
Set rng = Range("Employees")
'do someting with it
Set rng = Cells(ActiveCell.Row, 1)
'do something with this rang
 
Top