ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting a Range name (https://www.excelbanter.com/excel-programming/330526-setting-range-name.html)

Tempy

Setting a Range name
 
Good Day, I have to name a range and it can vary, dependant on the
spreadsheet recieved and the amount od data but all the used area will
be the range name KTL.

At this point in time it is A1:CQ847

This could go to CQ5000

Could somebody help me with some code please.

Thanks in advance

Tempy

*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips[_6_]

Setting a Range name
 

set myRange = Range("A1:C" & cells(rows.count,"C").end(xlup).row)

--

HTH

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


"Tempy" wrote in message
...
Good Day, I have to name a range and it can vary, dependant on the
spreadsheet recieved and the amount od data but all the used area will
be the range name KTL.

At this point in time it is A1:CQ847

This could go to CQ5000

Could somebody help me with some code please.

Thanks in advance

Tempy

*** Sent via Developersdex http://www.developersdex.com ***




Tom Ogilvy

Setting a Range name
 
You mean like Insert=Name=Define kind of name a range?

ActiveSheet.UsedRange = "KTL"

--
Regards,
Tom Ogilvy


"Tempy" wrote in message
...
Good Day, I have to name a range and it can vary, dependant on the
spreadsheet recieved and the amount od data but all the used area will
be the range name KTL.

At this point in time it is A1:CQ847

This could go to CQ5000

Could somebody help me with some code please.

Thanks in advance

Tempy

*** Sent via Developersdex http://www.developersdex.com ***




Tempy

Setting a Range name
 
Thanks Bob, but i need to test the range and then name it as KTL, as the
range is not fixed but varying.

I tried this but it name it from A1:C847, but the width or number of
columns can also vary.

Thanks

Tempy

*** Sent via Developersdex http://www.developersdex.com ***

Tempy

Setting a Range name
 
Hi Tom, I need to name the used range as KTL but it can vary.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips[_7_]

Setting a Range name
 
Range("A1:C" & cells(rows.count,"C").end(xlup).row).Name = "KTL"

--
HTH

Bob Phillips

"Tempy" wrote in message
...
Thanks Bob, but i need to test the range and then name it as KTL, as the
range is not fixed but varying.

I tried this but it name it from A1:C847, but the width or number of
columns can also vary.

Thanks

Tempy

*** Sent via Developersdex http://www.developersdex.com ***




Tom Ogilvy

Setting a Range name
 
What is that statement supposed to mean?

--
Regards,
Tom Ogilvy


"Tempy" wrote in message
...
Hi Tom, I need to name the used range as KTL but it can vary.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 08:20 AM.

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