Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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 ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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 ***



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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 ***
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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 ***


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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 ***



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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 ***



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
VBA setting Range Jeff Excel Discussion (Misc queries) 1 December 2nd 05 07:36 PM
Setting a Range Tempy Excel Programming 6 June 15th 04 03:46 PM
range setting Mike Harris Excel Programming 5 November 22nd 03 05:07 AM
Setting a range using VBA [email protected] Excel Programming 4 November 14th 03 05:16 AM


All times are GMT +1. The time now is 04:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"