ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA & Coding a dynamic range (https://www.excelbanter.com/excel-programming/345885-vba-coding-dynamic-range.html)

Mark Ivey

VBA & Coding a dynamic range
 
I was wondering if anyone could help me out with some code issues.

I have found several links showing how to define a name range with VBA, but I would like to do so with a dynamic name range as well. Can someone help me with some generic code on this issue?

--
Mark Ivey

UoP e-mail:
Personal e-mail:


Bob Phillips[_6_]

VBA & Coding a dynamic range
 

Set myRng = Range(Range("A1"),Cells(Rows.Count,"A").End(xlUp))
myRng.Name = "some_name"

which will get everytrhing in column A and name it "some_name"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mark Ivey" wrote in message ...
I was wondering if anyone could help me out with some code issues.

I have found several links showing how to define a name range with VBA, but I would like to do so with a dynamic name range as well. Can someone help me with some generic code on this issue?

--
Mark Ivey

UoP e-mail:
Personal e-mail:


Mark Ivey

VBA & Coding a dynamic range
 
Thanks Bob. This works out great.

--
Mark Ivey

UoP e-mail:
Personal e-mail:

"Bob Phillips" wrote in message ...

Set myRng = Range(Range("A1"),Cells(Rows.Count,"A").End(xlUp))
myRng.Name = "some_name"

which will get everytrhing in column A and name it "some_name"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mark Ivey" wrote in message ...
I was wondering if anyone could help me out with some code issues.

I have found several links showing how to define a name range with VBA, but I would like to do so with a dynamic name range as well. Can someone help me with some generic code on this issue?

--
Mark Ivey

UoP e-mail:

Personal e-mail:



All times are GMT +1. The time now is 11:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com